/* --- General & Root Styles --- */
:root {
    --primary-color: #3b82f6; /* A fresh, modern blue */
    --primary-hover: #2563eb;
    --background-color: #f8fafc; /* Lighter, cleaner background */
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #22c55e;
    --success-hover: #16a34a;
    --font-family: 'Poppins', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

.container {
    background-color: var(--surface-color);
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 680px; /* Wider for a more premium feel */
    text-align: center;
}

h1, h2 {
    color: var(--text-color);
}

h1 {
    font-size: 1.8em;
    font-weight: 600;
}

h2 {
    font-size: 1.4em;
    font-weight: 600;
    margin-top: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* --- Profile & Public Page Styles --- */
.profile-header {
    margin-bottom: 30px;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--surface-color);
    box-shadow: 0 0 0 4px var(--primary-color);
}

.username-display {
    font-size: 1.1em;
    color: var(--text-light);
    margin-top: -15px;
    margin-bottom: 20px;
}

.google-signin-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.google-signin-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    text-decoration: none;
}

.links-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-item {
    display: block;
    background-color: var(--primary-color);
    color: white;
    padding: 18px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.link-item:hover {
    background-color: var(--primary-hover);
    transform: scale(1.03);
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
    color: white;
}

/* --- Dashboard Styles --- */
form {
    margin-bottom: 20px;
}

form input[type="text"],
form input[type="url"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
form input[type="text"]:focus,
form input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}


form button[type="submit"] {
    background-color: var(--success-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
}
form button[type="submit"]:hover {
    background-color: var(--success-hover);
    transform: translateY(-2px);
}

ul#sortable-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

ul#sortable-links li {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column; /* Mobile first */
    gap: 10px;
    align-items: stretch;
    cursor: grab;
    transition: background-color 0.2s ease;
    /* FIX FOR MOBILE SCROLLING */
    touch-action: pan-y;
}
ul#sortable-links li:hover {
    background-color: #f9fafb;
}

ul#sortable-links li.inactive-link {
    opacity: 0.6;
}

.edit-link-form {
    display: flex;
    flex-direction: column; /* Mobile first */
    flex-grow: 1;
    gap: 10px;
}
.edit-link-form input {
    margin: 0;
}
.edit-link-form button {
    background-color: var(--primary-color);
    padding: 8px 15px;
}
.edit-link-form button:hover {
    background-color: var(--primary-hover);
}


.link-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.delete-button {
    background-color: var(--danger-color) !important;
}
.delete-button:hover {
    background-color: var(--danger-hover) !important;
}

.click-count {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.username-form {
    display: flex;
    margin-bottom: 30px;
    justify-content: center;
    flex-direction: column;
    align-items: stretch; /* Makes form elements take up the full width */
    gap: 5px; /* Adjusts spacing for a vertical layout */
}

.username-form button {
        order: 4; /* Puts the button at the very bottom of the form */
    }
.username-form label {
    color: var(--text-light);
    white-space: normal; /* Allows the URL to wrap if needed */
    word-break: break-all;
}

.username-form input[type="text"] {
        text-align: center;
    }

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { display:none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- Admin Panel Styles --- */
.admin-section {
    margin-bottom: 40px;
    text-align: left;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}
.admin-table th, .admin-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 0.95em;
}
.admin-table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-align: left;
}
.admin-table tr:hover {
    background-color: #f8fafc;
}

/* Username Availability Status */
#username-status {
    font-size: 0.9em;
    font-weight: 500;
    margin-left: 0px;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    order: 3;
}

.status-available {
    color: #16a34a; /* Darker success green */
    background-color: #f0fdf4;
}

.status-unavailable {
    color: #dc2626; /* Darker danger red */
    background-color: #fef2f2;
}

/* Style for disabled button */
form button:disabled {
    background-color: #9ca3af; /* Gray */
    cursor: not-allowed;
    transform: none;
}
form button:disabled:hover {
    background-color: #9ca3af;
    box-shadow: none;
}
/* ------------------ */
/* [START] ADD THESE STYLES TO THE END OF YOUR CSS FILE */

/* --- User Profile Bio & Blog List --- */
.user-bio {
    font-size: 1em;
    color: var(--text-light);
    margin-top: -10px;
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.blogs-section {
    margin-top: 40px;
    text-align: left;
}

.blogs-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .blogs-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.blog-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
    text-decoration: none;
}

.blog-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.blog-card-content {
    padding: 20px;
}

.blog-card-category {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.blog-card-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}


/* --- Dashboard Additions --- */
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.settings-form {
    text-align: left;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}
.toggle-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.hidden {
    display: none;
}
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background-color: white;
}
.editor-link {
    font-weight: bold;
    color: var(--success-color);
}


/* --- Blog Dashboard & Editor --- */
.button-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 25px;
}
.button-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}
.actions-cell {
    display: flex;
    gap: 10px;
}
.action-button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    color: white;
}
.action-button.edit { background-color: var(--primary-color); }
.action-button.delete { background-color: var(--danger-color); }

.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}


/* --- Public Blog Post Page --- */
.blog-post-container {
    max-width: 800px;
    text-align: left;
}

.blog-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.blog-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.2;
    margin: 10px 0 0 0;
}
.blog-meta {
    color: var(--text-light);
    font-size: 0.9em;
}

.blog-featured-image {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 30px;
}

.blog-content {
    font-size: 1.1em;
    line-height: 1.8;
}
.blog-content h2, .blog-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}
.blog-content p {
    margin-bottom: 1.5em;
}
.blog-content a {
    text-decoration: underline;
}
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ------------------ */

/* style.css */

/* ... add this at the end of the file ... */

/* --- Dashboard Profile Picture --- */
.dashboard-profile-pic-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 15px auto 25px;
}

.dashboard-profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
}

.dashboard-profile-pic-container a {
    display: block;
    position: relative;
}

.dashboard-profile-pic-container .change-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: white;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.dashboard-profile-pic-container a:hover .change-icon {
    transform: scale(1.1);
    background-color: var(--primary-color);
    color: white;
}

.dashboard-profile-pic-container .change-icon svg {
    width: 20px;
    height: 20px;
}




/* style.css */

/* ... add this at the end of the file ... */

/* --- Homepage Styles --- */
.homepage-container {
    max-width: 900px;
    text-align: center;
    /*padding: 20px;*/
}

.homepage-header {
    padding: 60px 20px;
    border-radius: 16px;
    margin-bottom: 40px;
}

.homepage-header h1 {
    font-size: 3em;
    font-weight: 700;
}

.homepage-header p {
    font-size: 1.2em;
    color: var(--text-light);
    max-width: 600px;
    margin: 15px auto 30px;
}

.benefits {
    margin-bottom: 50px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
    text-align: left;
}

@media (min-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.benefit-item {
    background-color: var(--background-color);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.benefit-item h3 {
    margin-top: 0;
}

.contact-section {
    margin-bottom: 50px;
}

.contact-details {
    line-height: 1.7;
    color: var(--text-light);
}

.contact-details strong {
    color: var(--text-color);
}

.homepage-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--text-light);
}

.homepage-footer a {
    color: var(--text-light);
}



/* --- Load More Button --- */
.load-more-container {
    text-align: center;
    margin-top: 20px;
}

#load-more-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
}

#load-more-btn:hover {
    background-color: var(--primary-hover);
}


/* START: NEW STYLES FOR THE OUR BLOG PAGE BUTTON */
.load-more-blogs-btn {
    background-color: var(--surface-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600; /* Bolder text */
    transition: all 0.2s ease;
}

.load-more-blogs-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px); /* Slight lift effect */
}

.load-more-blogs-btn:disabled {
    background-color: #e2e8f0; /* Lighter gray for disabled state */
    border-color: #e2e8f0;
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}
/* END: NEW STYLES */


.success-message {
    color: #155724; /* Dark green text */
    background-color: #d4edda; /* Light green background */
    border: 1px solid #c3e6cb; /* Green border */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-message {
    color: #721c24; /* Dark red text */
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c6cb; /* Red border */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}


.hero-headline {
    font-size: 3.5em;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px 0;
    background: linear-gradient(45deg, var(--primary-color), #1e293b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* --- Features Section --- */
.features-section {
    padding: 40px 10px;
    background-color: var(--background-color);
    border-radius: 20px;
    margin-top: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.feature-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: left;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: #eef2ff; /* Light blue background */
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.feature-description {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}


/* --- Final CTA Section --- */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.cta-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
    text-decoration: none;
}
.final-cta-section {
    padding: 40px 20px;
    text-align: center;
}

.cta-features-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 30px;
    display: inline-block;
    text-align: left;
    font-size: 1.1em;
    line-height: 2;
    color: var(--text-color);
}

.cta-button-secondary {
    background-color: var(--success-color);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}
.cta-button-secondary:hover {
    background-color: var(--success-hover);
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.4);
    color:white;
}


.faq-section {
    padding: 40px 20px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.faq-item[open] {
    border-color: var(--primary-color);
}

.faq-item:hover {
    border-color: var(--primary-hover);
}

.faq-question {
    padding: 20px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Hide the default marker */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::-webkit-details-marker {
    display: none; /* Hide marker for Chrome/Safari */
}

/* Custom dropdown icon */
.faq-question::after {
    content: '+';
    font-size: 1.8em;
    font-weight: 400;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
    content: '−'; /* Minus sign when open */
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 20px 20px;
    color: var(--text-light);
    line-height: 1.7;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 20px;
}










/* --- Responsive Design --- */
@media (min-width: 768px) {
    .container {
        padding: 40px;
    }
    
    .edit-link-form {
        flex-direction: row;
        align-items: center;
    }

    ul#sortable-links li {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .link-actions {
        padding-top: 0;
        border-top: none;
        width: auto; /* Allow it to shrink to its content */
    }
}
/*@media (min-width: 1024px) {*/
/*    .features-grid {*/
        grid-template-columns: repeat(4, 1fr); /* Four features per row on desktops */
/*    }*/
/*}*/