/* =========================================================
   P.T. LEE CHENGALVARAYA NAICKER TRUST
   TOP BAR + FLASH NEWS (NAVY & GOLD THEME)
   FULL RESPONSIVE MASTER: DESKTOP, LAPTOP, TABLET & MOBILE
========================================================= */

/* =========================================================
   1. TOP BAR BASE
========================================================= */
.topbar {
    width: 100%;
    background: #08002d;
    color: #ffffff;
    font-family: "Poppins", Arial, sans-serif;
    border-bottom: 1px solid rgba(255, 216, 77, 0.35);
    position: relative;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

/* Elegant Top Gold Accent Line */
.topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        #ffd84d,
        #fff2a6,
        #ffd84d,
        transparent
    );
}

/* =========================================================
   2. TOPBAR CONTAINER
========================================================= */
.topbar-container {
    width: 100%;
    max-width: 1520px;
    min-height: 44px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* =========================================================
   3. LEFT SIDE (MOTTO)
========================================================= */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.topbar-motto-tamil {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.topbar-motto-tamil i {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #08002d;
    background: linear-gradient(135deg, #ffe98a, #ffd43b);
    border-radius: 50%;
    font-size: 11.5px;
    box-shadow: 0 2px 8px rgba(255, 216, 77, 0.35);
    flex-shrink: 0;
}

.topbar-motto {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.topbar-motto i {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #08002d;
    background: linear-gradient(135deg, #ffe98a, #ffd43b);
    border-radius: 50%;
    font-size: 11px;
    box-shadow: 0 2px 7px rgba(255, 216, 77, 0.35);
    flex-shrink: 0;
}

/* =========================================================
   4. RIGHT SIDE (CONTACTS, SOCIAL, CAREER)
========================================================= */
.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

/* Email & Phone Links */
.topbar-contact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #ffffff;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 6px;
    transition: color 0.25s ease, background 0.25s ease;
}

.topbar-contact:hover {
    color: #ffd84d;
    background: rgba(255, 255, 255, 0.08);
}

.topbar-contact i {
    color: #ffd84d;
    font-size: 12px;
}

/* Vertical Divider */
.topbar-divider {
    width: 1px;
    height: 18px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 216, 77, 0.45),
        transparent
    );
    flex-shrink: 0;
}

/* Social Media Buttons */
.topbar-social {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 216, 77, 0.25);
    font-size: 12.5px;
    flex-shrink: 0;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.topbar-social:hover {
    color: #ffffff;
    transform: translateY(-2px) scale(1.08);
    background: rgba(255, 216, 77, 0.2);
    border-color: #ffd84d;
    box-shadow: 0 4px 12px rgba(255, 216, 77, 0.35);
}

.topbar-social.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.topbar-social.instagram:hover {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    border-color: #fd1d1d;
}

.topbar-social.youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
}

/* Career CTA Button */
.career-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 9999px;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.career-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.5);
    color: #ffffff;
}

.badge-pulse {
    width: 7px;
    height: 7px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* =========================================================
   5. FLASH NEWS TICKER CONTAINER
========================================================= */
.flash-news {
    width: 100%;
    background: #08002d;
    border-bottom: 1px solid rgba(255, 216, 77, 0.22);
    position: relative;
    z-index: 10000;
}

.flash-news-container {
    width: 100%;
    max-width: 1520px;
    height: 42px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
}

/* =========================================================
   6. FLASH NEWS GOLD LABEL
========================================================= */
.flash-news-label {
    flex: 0 0 auto;
    min-width: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 20px;
    background: linear-gradient(135deg, #ffd84d 0%, #f4bd19 50%, #dca400 100%);
    color: #08002d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    white-space: nowrap;
    position: relative;
    z-index: 5;
    box-shadow: 4px 0 14px rgba(0, 0, 0, 0.25);
}

.flash-news-label::before {
    content: "";
    width: 4px;
    height: 22px;
    background: #8b0000;
    border-radius: 3px;
    position: absolute;
    left: 8px;
}

.flash-news-label i {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #8b0000;
    border-radius: 50%;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: newsBell 2s ease-in-out infinite;
}

@keyframes newsBell {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-14deg); }
    20% { transform: rotate(14deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* =========================================================
   7. MARQUEE SCROLLING VIEWPORT & FADES
========================================================= */
.flash-news-content {
    flex: 1;
    min-width: 0;
    height: 42px;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(0, 0, 0, 0.18);
}

/* Left & Right Soft Fade Masks */
.flash-news-content::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 45px;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(90deg, #08002d, transparent);
}

.flash-news-content::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 45px;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(270deg, #08002d, transparent);
}

/* =========================================================
   8. 60FPS HARDWARE-ACCELERATED TRACK
========================================================= */
.flash-news-track {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-width: max-content;
    height: 42px;
    white-space: nowrap;
    
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;

    animation: smoothNewsMarquee 32s linear infinite;
}

@keyframes smoothNewsMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.flash-news-content:hover .flash-news-track {
    animation-play-state: paused;
}

/* News Items Styling */
.flash-news-track a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 0 24px;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.flash-news-track a:hover {
    color: #ffd84d;
    text-decoration: underline;
}

.flash-news-track a img {
    height: 15px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 1px 4px rgba(255, 0, 0, 0.6));
}

.flash-news-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffd84d;
    font-size: 13px;
    font-weight: 700;
    padding: 0 8px;
    flex-shrink: 0;
    text-shadow: 0 0 7px rgba(255, 216, 77, 0.65);
}

/* =========================================================
   9. BREAKPOINTS: DESKTOP, LAPTOP, TABLET, MOBILE
========================================================= */

/* --- A. LAPTOPS & SMALL DESKTOPS (1024px – 1366px) --- */
@media (max-width: 1366px) {
    .topbar-container {
        padding: 0 18px;
        gap: 15px;
    }
    .topbar-motto {
        display: none; /* Hide secondary motto on laptops for spacious layout */
    }
    .topbar-contact {
        font-size: 11px;
        padding: 4px 6px;
    }
    .career-btn {
        padding: 5px 13px;
        font-size: 11.5px;
    }
    .flash-news-label {
        min-width: 135px;
        padding: 0 16px;
    }
}

/* --- B. TABLETS LANDSCAPE & TABLETS (768px – 1023px) --- */
@media (max-width: 1023px) {
    .topbar-container {
        padding: 0 16px;
        gap: 12px;
        min-height: 42px;
    }
    .topbar-left {
        gap: 8px;
    }
    .topbar-motto-tamil {
        font-size: 12px;
    }
    .topbar-motto-tamil i {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    /* Hide contact text labels, show only icons for clean spacing */
    .topbar-contact span {
        display: none;
    }
    .topbar-contact {
        padding: 5px 7px;
    }
    .topbar-contact i {
        font-size: 13px;
    }
    .career-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    .flash-news-container, .flash-news-content, .flash-news-track {
        height: 40px;
    }
    .flash-news-label {
        min-width: 125px;
        font-size: 11px;
        padding: 0 14px;
    }
    .flash-news-track a {
        font-size: 12.5px;
        padding: 0 18px;
    }
    .flash-news-track {
        animation-duration: 28s;
    }
}

/* --- C. LARGE MOBILES & PHABLETS (576px – 767px) --- */
@media (max-width: 767px) {
    .topbar-container {
        padding: 0 12px;
        min-height: 40px;
        gap: 8px;
    }
    .topbar-motto-tamil {
        font-size: 11px;
    }
    .topbar-right {
        gap: 6px;
    }
    .topbar-divider {
        display: none; /* Cleaner look on mobile */
    }
    .topbar-social {
        width: 26px;
        height: 26px;
        font-size: 11.5px;
    }
    .career-btn {
        padding: 4px 10px;
        font-size: 11px;
        gap: 5px;
    }
    .flash-news-container, .flash-news-content, .flash-news-track {
        height: 38px;
    }
    .flash-news-label {
        min-width: 105px;
        font-size: 10.5px;
        padding: 0 12px;
        gap: 6px;
    }
    .flash-news-label::before {
        left: 5px;
        height: 18px;
    }
    .flash-news-label i {
        width: 19px;
        height: 19px;
        font-size: 9.5px;
    }
    .flash-news-content::before,
    .flash-news-content::after {
        width: 25px; /* Shorter fade so text has more room */
    }
    .flash-news-track a {
        font-size: 12px;
        padding: 0 14px;
    }
    .flash-news-track {
        animation-duration: 25s;
    }
}

/* --- D. STANDARD & SMALL MOBILES (320px – 575px) --- */
@media (max-width: 575px) {
    .topbar-container {
        padding: 0 10px;
        min-height: 38px;
    }
    .topbar-motto-tamil {
        font-size: 10.5px;
        gap: 6px;
    }
    .topbar-motto-tamil i {
        width: 20px;
        height: 20px;
        font-size: 9.5px;
    }
    .topbar-contact {
        padding: 4px 5px;
    }
    .topbar-social {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .career-btn {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }
    .badge-pulse {
        width: 6px;
        height: 6px;
    }
    .flash-news-container, .flash-news-content, .flash-news-track {
        height: 36px;
    }
    .flash-news-label {
        min-width: 85px;
        font-size: 9.5px;
        padding: 0 8px;
        gap: 5px;
    }
    .flash-news-label::before {
        display: none;
    }
    .flash-news-content::before,
    .flash-news-content::after {
        width: 18px;
    }
    .flash-news-track a {
        font-size: 11px;
        padding: 0 10px;
    }
}

/* --- E. VERY NARROW PHONES (below 375px e.g. iPhone SE / 320px) --- */
@media (max-width: 375px) {
    .topbar-motto-tamil span {
        display: inline-block;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-contact {
        display: none; /* Preserve space for social + career CTA */
    }
    .flash-news-label {
        min-width: 75px;
        font-size: 9px;
        padding: 0 6px;
    }
    .flash-news-label i {
        display: none;
    }
    .flash-news-track a {
        font-size: 10.5px;
        padding: 0 8px;
    }
}

/* --- F. ACCESSIBILITY: REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .flash-news-track,
    .flash-news-label i,
    .badge-pulse {
        animation: none !important;
    }
}
