/* ======================================================================
   PROFESSIONAL STYLESHEET FOR SECURE ADMIN & PUBLIC SITE
   ====================================================================== */

/* --- 1. Global Styles & Variables --- */
:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #fff;
    --border-color: #dee2e6;
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --border-radius: 0.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* --- 2. Public Homepage Styles (index.php) --- */
.public-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.public-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.public-header nav a {
    margin-left: 1.5rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.public-header nav a:hover {
    color: var(--primary);
}

.btn-login {
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-login:hover {
    background-color: #0b5ed7;
    color: var(--white);
}

.hero-section {
    text-align: center;
    padding: 6rem 1rem;
}

.hero-section h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}


/* --- 3. Authentication & Form Styles (auth.php) --- */
.full-page-container {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
}

.form-container {
    width: 100%;
    max-width: 450px;
}

.info-text {
    color: var(--secondary);
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
}


/* --- 4. Admin Dashboard Styles (dashboard.php) --- */
.admin-header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-header a {
    color: var(--white);
    text-decoration: none;
    background: var(--danger);
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 500;
}

.dashboard-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

th, td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: #e9ecef;
}

td a {
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
}

.role-tag {
    padding: 0.25em 0.75em;
    border-radius: 1em;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    display: inline-block;
    text-transform: capitalize;
}

.role-admin {
    background-color: var(--danger);
}

.role-editor {
    background-color: var(--secondary);
}


/* --- 5. Shared Components (Used across multiple pages) --- */
.card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header h2, .card-header h3 {
    margin: 0;
}

button {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

button:hover {
    background-color: #0b5ed7;
}

.message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    text-align: center;
}

.message.success {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.message.error {
    background: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

/* --- 6. Responsive Design --- */
@media (max-width: 768px) {
    .public-header {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-section h2 {
        font-size: 2.2rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}