/* Global Variables & Design Tokens */
:root {
    --primary-color: #125874;
    --secondary-color: #ff7351;
    --background-color: #ffffff;
    --text-color: #333333;
    --light-gray: #f4f4f4;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --header-height: 70px;
    --footer-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Main Header */
header {
    background-color: var(--primary-color);
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header-left {
    background-color: var(--secondary-color);
    height: 100%;
    padding: 0 clamp(10px, 3vw, 40px) 0 20px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 1 auto;
    min-width: min-content;
}

/* Skewed edge effect */
.header-left::after {
    content: '';
    position: absolute;
    top: 0;
    right: -30px;
    width: 60px;
    height: 100%;
    background-color: var(--secondary-color);
    transform: skewX(-20deg);
    z-index: -1;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 3vw, 40px);
    color: white;
    padding: 0 10px;
}

.header-right {
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    color: white;
}

.contact-value {
    font-size: clamp(0.9rem, 1.2vw, 1.25rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
}

.header-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

nav {
    display: flex;
    justify-content: flex-end;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 65px;
    width: auto;
    margin-right: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.portal-title {
    font-size: clamp(1.1rem, 2.2vw, 1.8rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav a:hover {
    opacity: 0.8;
}

/* Footer */
/* Footer */
/* Footer */
/* Footer */
footer {
    background: linear-gradient(135deg, #0e4b65 0%, #062c3d 100%);
    color: #e6e6e6;
    padding: 60px 20px 20px;
    position: relative;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* Texture overlay for premium feel */
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.8;
    pointer-events: none;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 50px;
    position: relative;
    z-index: 2;
}

.footer-section {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
}

/* Left: Logo & Tagline */
.logo-section {
    align-items: flex-start;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.footer-tagline {
    color: #a8b2b8;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
    margin-top: 5px;
    font-weight: 500;
}

/* Middle: Contact Info */
.footer-section h3 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    text-decoration: none;
    transition: transform 0.2s;
}

.contact-row i {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-top: 4px;
    flex-shrink: 0;
}

.contact-row.clickable:hover {
    transform: translateX(5px);
    color: white;
}

/* Right: Social */
.social-links-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    width: fit-content;
}

.social-chip:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 115, 81, 0.3);
}

/* Bottom Copyright */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: #8c9da6;
    position: relative;
    z-index: 2;
}

.footer-bottom a {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
    opacity: 0.8;
}

.footer-bottom a:hover {
    color: var(--secondary-color);
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    footer {
        padding: 40px 20px 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .footer-section {
        align-items: center;
    }

    .logo-section {
        align-items: center;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .contact-row {
        justify-content: center;
        text-align: left;
        /* Keep address text left aligned even if container is centered */
    }

    /* Ensure icon is still relative to text block */
    .contact-row {
        text-align: center;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .contact-row i {
        margin-top: 0;
    }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0d4257;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #e66646;
}

.admin-only {
    display: none;
}

.admin-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Newspaper Grid */
.newspaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.newspaper-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed);
    border: 1px solid #eee;
}

.newspaper-card:hover {
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    background-color: var(--light-gray);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1100px) {
    .header-center {
        gap: 20px;
    }

    .contact-item {
        gap: 8px;
    }

    .contact-icon {
        font-size: 1.3rem;
    }

    .contact-label {
        font-size: 0.6rem;
    }

    .header-divider {
        height: 30px;
    }
}

@media (max-width: 900px) {
    .header-center {
        gap: 10px;
    }

    .contact-info {
        display: none;
        /* Hide text, keep icons for minimalist view */
    }
}

@media (max-width: 768px) {
    header {
        height: 60px;
        /* Slimmer header for mobile */
    }

    .header-left {
        width: auto;
        padding: 0 30px 0 15px;
        min-width: unset;
    }

    .header-left::after {
        right: -15px;
        width: 30px;
    }

    .header-center {
        display: none;
        /* Hide contact info on mobile as requested */
    }

    .header-right {
        flex: 1;
        padding: 0 10px;
        justify-content: flex-end;
    }

    .portal-title {
        font-size: 0.9rem;
    }

    nav ul {
        gap: 8px;
    }

    nav ul {
        gap: 6px;
        flex-wrap: nowrap;
    }

    #user-display-name {
        font-size: 0.65rem !important;
        max-width: 80px;
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        opacity: 0.9;
        flex-shrink: 1;
    }

    #logout-btn {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
        white-space: nowrap;
        min-width: fit-content;
        flex-shrink: 0;
    }

    .header-logo {
        height: 45px;
        margin-right: 10px;
    }

    .btn-secondary {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    main {
        padding: 15px;
    }
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.loading-indicator.active {
    opacity: 1;
    visibility: visible;
    top: 30px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Main Banner */
.main-banner-container {
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.main-banner-img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--border-radius);
}


/* Mobile Navigation Fixes */
@media (max-width: 768px) {
    .header-left {
        padding-right: 10px !important;
    }

    .portal-title {
        font-size: 0.8rem !important;
    }

    nav ul {
        gap: 4px !important;
    }

    nav a {
        font-size: 0.8rem !important;
    }

    /* Reduce default padding for all nav links on mobile */
    nav li>a:not(.btn) {
        padding: 5px !important;
    }

    nav li>a.btn-secondary {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
}

/* Welcome Box */
.welcome-box {
    background-color: var(--background-color);
    border: 1px solid #e0e0e0;
    padding: 20px 30px;
    /* Reduced padding */
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: 700px;
    /* Reduced max-width */
    margin: 0 auto;
    display: inline-block;
    width: 90%;
}

@media (max-width: 768px) {

    .welcome-box,
    .hero {
        display: none !important;
    }
}