/* --- Global Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.65; /* Slightly increased for better readability */
    background-color: #f8f9fa; /* Light, neutral background */
    color: #343a40; /* Darker gray for main text, better contrast */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 75px; /* Default height of the fixed header */
}

.dashboard-body { /* Styles specific to index.php */
    padding-top: 0; /* No fixed header */
    background-color: #f7f9fc; /* Bright, fresh background for dashboard */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Slightly less bold than 700 for elegance */
    color: #2c3e50;
    margin-bottom: 0.85em;
    line-height: 1.3;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; } /* Slightly reduced for balance */
h3 { font-size: 1.6rem; }

a {
    color: #3A8DDE; /* Refined primary blue */
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2c73b9; /* Darker shade of blue on hover */
    text-decoration: none; /* Avoid underline for cleaner look, rely on color change */
}

p {
    margin-bottom: 1.1rem;
    font-size: 1rem;
    color: #495057; /* Softer text color for paragraphs */
}

/* --- Header --- */
.site-header {
    background-color: #ffffff;
    padding: 12px 0; /* Adjusted padding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* Softer shadow */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.dashboard-body .site-header { /* Static header for dashboard */
    position: static;
    padding: 12px 0; /* Consistent padding with default */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* Slightly different shadow if needed */
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 { /* Logo */
    font-size: 1.7rem; /* Adjusted for balance */
    margin-bottom: 0;
    color: #3A8DDE;
    font-weight: 700;
}

.dashboard-body .site-header h1 {
    font-size: 1.5rem; /* Compact logo for dashboard's static header */
}

.site-header nav {
    display: flex;
    align-items: center;
}

.site-header nav span { /* Welcome message */
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #555e68;
    margin-right: 20px;
}

.site-header nav a { /* General nav links (if any others are added) */
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #495057;
    margin-left: 15px;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-header nav a:hover {
    background-color: #e9ecef; /* Subtle hover for general links */
    color: #2c73b9;
}

.site-header nav .logout-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #c0392b; /* Red for logout */
    font-size: 0.9rem;
    padding: 7px 14px; /* Slightly adjusted padding */
    border-radius: 6px;
    border: 1px solid #e7cbc8; /* Lighter red border */
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-header nav .logout-link:hover {
    background-color: #c0392b;
    color: #fff;
    border-color: #c0392b;
    text-decoration: none;
}


/* --- Main Content --- */
main {
    flex-grow: 1;
    padding: 30px 0; /* Adjusted padding */
}

.dashboard-body main {
    padding: 25px 0; /* Specific padding for dashboard main content */
}

/* --- Footer --- */
.site-footer {
    background-color: #343a40; /* Darker, more modern footer */
    color: #adb5bd; /* Lighter text for contrast */
    text-align: center;
    padding: 25px 0;
    margin-top: auto;
}

.site-footer p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #e9ecef; /* Even lighter for footer text */
}

/* --- Form Styling (Login & Register - Retained & Refined) --- */
.auth-container {
    max-width: 450px; /* Slightly narrower */
    margin: 40px auto; /* More top/bottom margin */
    padding: 35px 45px;
    background-color: #ffffff;
    border-radius: 10px; /* Softer corners */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); /* Refined shadow */
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.7rem;
    color: #333;
}

.auth-container .form-group {
    margin-bottom: 22px;
}

.auth-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500; /* Using Inter's 500 weight */
    color: #495057;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.auth-container input[type="text"],
.auth-container input[type="password"],
.auth-container input[type="email"] {
    width: 100%;
    padding: 14px 18px; /* More padding for better touch targets */
    font-size: 1rem;
    border: 1px solid #ced4da; /* Standard Bootstrap-like border color */
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #f8f9fa; /* Light input background */
}

.auth-container input[type="text"]:focus,
.auth-container input[type="password"]:focus,
.auth-container input[type="email"]:focus {
    border-color: #3A8DDE;
    box-shadow: 0 0 0 0.2rem rgba(58, 141, 222, 0.2);
    outline: none;
    background-color: #fff;
}

.auth-container button[type="submit"] {
    width: 100%;
    padding: 14px 18px;
    background-color: #3A8DDE;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.auth-container button[type="submit"]:hover {
    background-color: #2c73b9;
    transform: translateY(-1px);
}

.auth-container .error,
.auth-container .success {
    padding: 14px 18px;
    margin-bottom: 22px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.auth-container .error {
    color: #c0392b;
    background-color: #fdecea; /* Lighter red background */
    border: 1px solid #f5c6cb;
}
.auth-container .error p { margin-bottom: 5px; }
.auth-container .error p:last-child { margin-bottom: 0; }

.auth-container .success {
    color: #27ae60;
    background-color: #e6ffed;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.auth-container .form-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
}
.auth-container .form-link a { font-weight: 500; }


/* --- Dashboard (Index Page) Specifics --- */
.dashboard-body .search-container {
    margin-bottom: 25px;
}

.dashboard-body .search-container input[type="text"] {
    width: 100%;
    padding: 14px 20px; /* Generous padding */
    font-size: 1.05rem;
    color: #2c3e50;
    background-color: #ffffff;
    border: 1px solid #dbe શુભe6; /* Lighter, softer border */
    border-radius: 10px; /* More rounded */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); /* Subtle shadow for input */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.dashboard-body .search-container input[type="text"]::placeholder {
    color: #86909c; /* Softer placeholder */
}

.dashboard-body .search-container input[type="text"]:focus {
    border-color: #3A8DDE;
    box-shadow: 0 0 0 0.2rem rgba(58, 141, 222, 0.15), 0 2px 8px rgba(0,0,0,0.06); /* Combined focus shadow */
    outline: none;
}

.dashboard-body .total-pages-info {
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 20px;
    padding: 10px 18px; /* Adjusted padding */
    background-color: #e9ecef;
    border-radius: 8px; /* Consistent border radius */
    display: inline-block;
    font-weight: 500;
}

.dashboard-body .page-list {
    list-style: none;
    padding: 0;
}

.dashboard-body .page-list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 22px; /* Increased padding */
    margin-bottom: 12px; /* Space between items */
    border-radius: 10px; /* Softer, more modern radius */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07); /* Refined shadow */
    background: linear-gradient(145deg, #ffffff, #fdfdff); /* Very subtle gradient */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-body .page-list li:hover { /* Enhanced hover for premium feel */
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.dashboard-body .page-list li:active { /* From mobile-first styles */
    transform: scale(0.985) translateY(0); /* Adjusted tap feedback */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.dashboard-body .page-list .page-title-status {
    display: flex; /* Align title and status horizontally */
    justify-content: space-between; /* Push status to the right */
    align-items: center;
    width: 100%;
    margin-bottom: 10px; /* Space before page-info */
}

.dashboard-body .page-list .page-title {
    font-size: 1.2rem; /* Slightly larger title */
    color: #3A8DDE;
    font-weight: 600; /* Poppins bold */
    font-family: 'Poppins', sans-serif;
}
.dashboard-body .page-list .page-title.inactive {
    color: #2c3e50; /* Color for non-link titles */
}
.dashboard-body .page-list a.page-title:hover {
    color: #2c73b9;
}

.dashboard-body .page-list .status-activated,
.dashboard-body .page-list .status-not-activated {
    font-size: 0.85rem; /* Smaller status text */
    font-weight: 600; /* Bold status */
    padding: 4px 10px; /* Padding for badge-like appearance */
    border-radius: 15px; /* Pill shape */
    margin-left: 10px; /* Space from title */
    white-space: nowrap;
}

.dashboard-body .page-list .status-activated {
    color: #27ae60;
    background-color: #e6f7ef; /* Light green background */
}

.dashboard-body .page-list .status-not-activated {
    color: #c0392b;
    background-color: #fdecea; /* Light red background */
}

.dashboard-body .page-list .page-info {
    font-size: 0.9rem; /* Slightly smaller info text */
    color: #5f6c7b; /* Softer color for secondary info */
    width: 100%;
    text-align: left;
    border-top: 1px solid #eef2f7; /* Lighter separator */
    padding-top: 10px;
    line-height: 1.5;
}

.dashboard-body .no-pages-message {
    padding: 25px; /* More padding */
    text-align: center;
    font-size: 1.05rem;
    color: #5f6c7b;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    body:not(.dashboard-body) { /* Only apply fixed header padding if not dashboard */
        padding-top: 65px; /* Adjust for slightly smaller header */
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .site-header .container {
        flex-direction: column;
        align-items: center;
        padding-top: 5px; /* Add some padding when stacked */
        padding-bottom: 5px;
    }
    .site-header h1 {
        margin-bottom: 8px; /* Reduced margin */
    }
    .site-header nav {
        margin-top: 8px;
    }
    .site-header nav span {
        display: block; /* Stack welcome message */
        text-align: center;
        margin-right: 0;
        margin-bottom: 8px;
    }
    .site-header nav a { /* Includes logout */
        margin: 0 5px;
        padding: 7px 10px;
        font-size: 0.9rem;
    }
    .site-header nav .logout-link {
      font-size: 0.85rem;
    }

    .auth-container {
        width: 90%;
        padding: 25px 30px;
        margin-top: 20px;
    }
    .auth-container h2 { font-size: 1.5rem; }

    .dashboard-body .page-list .page-title-status {
        flex-direction: column; /* Stack title and status on small screens */
        align-items: flex-start;
    }
    .dashboard-body .page-list .status-activated,
    .dashboard-body .page-list .status-not-activated {
        margin-left: 0;
        margin-top: 6px; /* Add space when stacked */
    }
    .dashboard-body .page-list .page-title {
        font-size: 1.1rem;
    }
}

/* Styles from index.php's min-width: 480px query, adapted for dashboard */
@media (min-width: 480px) {
    .dashboard-body .site-header h1 {
        font-size: 1.6rem; /* Slightly larger for wider mobile */
    }
    .dashboard-body .site-header nav span { /* Welcome text on dashboard */
        font-size: 0.9rem;
    }
    .dashboard-body .page-list li {
        padding: 20px 25px; /* Larger padding */
    }
    .dashboard-body .page-list .page-title,
    .dashboard-body .page-list .page-title.inactive {
        font-size: 1.25rem; /* Larger page titles */
    }
    .dashboard-body .page-list .status-activated,
    .dashboard-body .page-list .status-not-activated {
        font-size: 0.9rem; /* Slightly larger status */
    }
    .dashboard-body .page-list .page-info {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }

    .auth-container { padding: 20px; }
    .auth-container input[type="text"],
    .auth-container input[type="password"],
    .auth-container input[type="email"],
    .auth-container button[type="submit"] {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    /* Further fine-tuning for very small screens for dashboard elements if needed */
    .dashboard-body .search-container input[type="text"] {
        padding: 12px 16px;
        font-size: 1rem;
    }
    .dashboard-body .page-list .page-title,
    .dashboard-body .page-list .page-title.inactive {
        font-size: 1.05rem; /* Ensure readability on smallest screens */
    }
    .dashboard-body .page-list .status-activated,
    .dashboard-body .page-list .status-not-activated {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
}