/* =============================================
   FARRARMERE PRIMARY SCHOOL PWA
   Mobile-First Responsive Design
   Colors: Blue (#1e73be), White (#ffffff), Dark Gray (#333333)
   ============================================= */

/* CSS Variables */
:root {
    --primary-blue: #1e73be;
    --primary-dark: #165a94;
    --white: #ffffff;
    --dark-gray: #333333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --text-gray: #666666;
    --success-green: #28a745;
    --warning-orange: #fd7e14;
    --danger-red: #dc3545;
    --purple: #6f42c1;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px; /* Space for footer nav */
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

/* =============================================
   HEADER
   ============================================= */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.header-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: var(--white);
    border-radius: 8px;
    padding: 4px;
}

.header-text {
    flex: 1;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.header-motto {
    font-size: 0.75rem;
    opacity: 0.9;
    font-style: italic;
}

/* =============================================
   CATEGORY FILTER
   ============================================= */
.category-filter {
    background: var(--white);
    padding: 12px 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--medium-gray);
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.filter-container {
    display: flex;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--medium-gray);
    border-radius: 20px;
    background: var(--white);
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.filter-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.filter-btn .icon {
    font-size: 1rem;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* Pull to Refresh Indicator */
.pull-indicator {
    text-align: center;
    padding: 16px;
    color: var(--text-gray);
    font-size: 0.85rem;
    display: none;
}

.pull-indicator.visible {
    display: block;
}

/* =============================================
   ANNOUNCEMENT CARDS
   ============================================= */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.announcement-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.announcement-card.urgent {
    border-left: 4px solid var(--danger-red);
}

.announcement-card.high {
    border-left: 4px solid var(--warning-orange);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--light-gray);
}

.card-content {
    padding: 16px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.card-category {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.card-category.general { background: rgba(30, 115, 190, 0.1); }
.card-category.academic { background: rgba(40, 167, 69, 0.1); }
.card-category.sports { background: rgba(253, 126, 20, 0.1); }
.card-category.events { background: rgba(111, 66, 193, 0.1); }
.card-category.urgent { background: rgba(220, 53, 69, 0.1); }

.card-title-section {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-urgent {
    background: var(--danger-red);
    color: var(--white);
}

.badge-high {
    background: var(--warning-orange);
    color: var(--white);
}

.badge-event {
    background: var(--purple);
    color: var(--white);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta-item .icon {
    font-size: 0.9rem;
}

/* =============================================
   ANNOUNCEMENT DETAIL MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--medium-gray);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-gray);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--medium-gray);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.modal-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 12px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--medium-gray);
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.modal-meta-item .icon {
    font-size: 1.1rem;
}

.modal-meta-item a {
    color: var(--primary-blue);
    text-decoration: none;
}

.modal-meta-item a:hover {
    text-decoration: underline;
}

.modal-content-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

.modal-content-text p {
    margin-bottom: 16px;
}

.modal-attachments {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--medium-gray);
}

.modal-attachments h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--dark-gray);
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--dark-gray);
    transition: var(--transition);
}

.attachment-item:hover {
    background: var(--medium-gray);
}

.attachment-icon {
    font-size: 1.5rem;
}

.attachment-name {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================
   FOOTER NAVIGATION
   ============================================= */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--medium-gray);
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--primary-blue);
    background: rgba(30, 115, 190, 0.1);
}

.nav-btn .icon {
    font-size: 1.5rem;
}

.nav-btn .label {
    font-weight: 500;
}

/* Offers Badge */
.nav-btn .offers-badge {
    position: relative;
}

.nav-btn .offers-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--danger-red);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* =============================================
   LOADING STATES
   ============================================= */
.skeleton {
    background: linear-gradient(90deg, var(--light-gray) 25%, var(--medium-gray) 50%, var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-image {
    height: 180px;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-title {
    height: 20px;
    margin-bottom: 12px;
    width: 80%;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark-gray);
}

.empty-state p {
    font-size: 0.9rem;
}

/* =============================================
   SPLASH SCREEN (Ads)
   ============================================= */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.splash-overlay.active {
    display: flex;
}

.splash-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.splash-banner {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    cursor: pointer;
}

.splash-info {
    padding: 16px;
}

.splash-business {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.splash-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.splash-contact {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.splash-contact a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.85rem;
}

.splash-contact a:hover {
    text-decoration: underline;
}

.splash-actions {
    display: flex;
    gap: 12px;
}

.splash-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.splash-btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.splash-btn-primary:hover {
    background: var(--primary-dark);
}

.splash-btn-secondary {
    background: var(--light-gray);
    color: var(--text-gray);
}

.splash-btn-secondary:hover {
    background: var(--medium-gray);
}

.splash-skip-timer {
    text-align: center;
    padding: 12px;
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* =============================================
   OFFERS PAGE/MODAL
   ============================================= */
.offers-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--light-gray);
    z-index: 300;
    display: none;
    flex-direction: column;
}

.offers-modal.active {
    display: flex;
}

.offers-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--white);
    border-bottom: 1px solid var(--medium-gray);
}

.offers-back {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-gray);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: var(--transition);
}

.offers-back:hover {
    background: var(--medium-gray);
}

.offers-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-gray);
}

.offers-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.offers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.offer-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.offer-banner {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.offer-info {
    padding: 16px;
}

.offer-business {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.offer-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.offer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.offer-contact a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.85rem;
}

.offer-contact a:hover {
    color: var(--primary-blue);
}

.offer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.offer-link:hover {
    background: var(--primary-dark);
}

/* =============================================
   NOTIFICATION PERMISSION PROMPT
   ============================================= */
.notification-prompt {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 150;
    display: none;
    animation: slideUp 0.3s ease;
}

.notification-prompt.active {
    display: block;
}

.notification-prompt-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-prompt .icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.notification-prompt-text h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--dark-gray);
}

.notification-prompt-text p {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.notification-prompt-actions {
    display: flex;
    gap: 8px;
}

.notification-prompt-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.notification-prompt-actions .btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.notification-prompt-actions .btn-secondary {
    background: var(--light-gray);
    color: var(--text-gray);
}

/* =============================================
   INSTALL PROMPT (PWA)
   ============================================= */
.install-prompt {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 150;
    display: none;
    animation: slideUp 0.3s ease;
}

.install-prompt.active {
    display: block;
}

.install-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-prompt .icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.install-prompt-text {
    flex: 1;
}

.install-prompt-text h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.install-prompt-text p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.install-prompt-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.install-prompt-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.install-prompt-actions .btn-install {
    background: var(--white);
    color: var(--primary-blue);
}

.install-prompt-actions .btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    top: 80px;
    left: 16px;
    right: 16px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--dark-gray);
    color: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: var(--success-green);
}

.toast.error {
    background: var(--danger-red);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   RESPONSIVE - TABLET & DESKTOP
   ============================================= */
@media (min-width: 768px) {
    .header {
        padding: 20px;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

    .header-title {
        font-size: 1.4rem;
    }

    .header-motto {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 24px;
    }

    .announcement-card {
        display: flex;
        flex-direction: row;
    }

    .card-image {
        width: 200px;
        height: auto;
        min-height: 150px;
    }

    .card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .modal-content {
        border-radius: var(--radius);
        max-height: 80vh;
        margin: auto;
    }

    .splash-content {
        max-width: 500px;
    }
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
    }

    .footer-nav {
        display: none;
    }

    .main-content {
        padding-bottom: 40px;
    }

    /* Desktop header with nav */
    .header-content {
        justify-content: space-between;
    }

    .desktop-nav {
        display: flex;
        gap: 24px;
    }

    .desktop-nav a {
        color: var(--white);
        text-decoration: none;
        font-weight: 500;
        opacity: 0.9;
        transition: var(--transition);
    }

    .desktop-nav a:hover {
        opacity: 1;
    }
}

/* =============================================
   ADMIN STYLES
   ============================================= */
.admin-container {
    min-height: 100vh;
    background: var(--light-gray);
}

.admin-header {
    background: var(--dark-gray);
    color: var(--white);
    padding: 16px;
}

.admin-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logout {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.admin-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.admin-tab {
    padding: 12px 24px;
    border: none;
    background: var(--white);
    color: var(--text-gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.admin-tab:hover {
    background: var(--medium-gray);
}

.admin-tab.active {
    background: var(--primary-blue);
    color: var(--white);
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

/* Admin Forms */
.admin-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-blue);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--text-gray);
}

.btn-secondary:hover {
    background: var(--medium-gray);
}

.btn-danger {
    background: var(--danger-red);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

/* Admin Table */
.admin-table-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.admin-table th {
    background: var(--light-gray);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
}

.admin-table td {
    font-size: 0.9rem;
}

.admin-table tr:hover {
    background: var(--light-gray);
}

.admin-table .actions {
    display: flex;
    gap: 8px;
}

.admin-table .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--medium-gray);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    border-color: var(--primary-blue);
    background: rgba(30, 115, 190, 0.05);
}

.file-upload input {
    display: none;
}

.file-upload .icon {
    font-size: 2rem;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.file-upload p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.file-preview {
    margin-top: 12px;
}

.file-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-sm);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.25rem;
    color: var(--dark-gray);
    text-align: center;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.login-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-red);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: none;
}

.login-error.active {
    display: block;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--medium-gray);
    transition: var(--transition);
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: var(--transition);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success-green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.published {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
}

.status-badge.draft {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-gray);
}

/* =============================================
   ACCESSIBILITY - Focus Styles
   ============================================= */
/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Remove focus outline on mouse click but keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to main content link (screen readers) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: var(--white);
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 0 0 1px var(--dark-gray);
        --shadow-lg: 0 0 0 2px var(--dark-gray);
    }

    .announcement-card,
    .btn,
    .filter-btn {
        border: 2px solid var(--dark-gray);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
