/**
 * 4D Greens Website - Modern Ticker Bar with Integrated Widgets
 * 
 * Features: Webmail, Weather/Time, Social Media, Messenger, News Ticker
 * Design: Sleek, smooth animations, modern glassmorphism
 */

/* ========================================
   TICKER CONTAINER - Main wrapper
   ======================================== */
/* ========================================
   TICKER CONTAINER - Main wrapper
   ======================================== */
.news-ticker-container {
    background: linear-gradient(135deg, rgba(44, 95, 69, 0.98) 0%, rgba(39, 174, 96, 0.98) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    position: sticky;
    top: 0;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 6px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
}

/* TOP ROW: Widgets and navigation */
.ticker-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 22px;
    height: 44px;
    min-height: 44px;
}

/* BOTTOM ROW: Scrolling content with lighter background */
.ticker-scroller-row {
    position: relative;
    height: 30px;
    min-height: 30px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 3px solid rgba(46, 204, 113, 0.8); /* header-accent underline */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    width: 100%;
}

.news-ticker-container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 
                0 3px 8px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ========================================
   LEFT WIDGETS - Webmail, Greenie, Messenger
   ======================================== */
.ticker-widgets-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

.ticker-widget-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    color: #ffffff !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-decoration: none !important;
    position: relative;
}

.ticker-widget-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
}

.ticker-widget-btn:active {
    transform: translateY(0) scale(0.98);
}

.ticker-widget-btn i {
    font-size: 0.7rem;
    color: #ffffff;
}

.ticker-widget-btn[data-widget="greenie"] {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    overflow: hidden;
}

.ticker-widget-btn[data-widget="greenie"]:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.ticker-greenie-icon {
    width: 70%;
    height: 70%;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
    display: block;
    filter: none;
    pointer-events: none;
}

/* Widget notification badges */
.ticker-widget-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(44, 95, 69, 1);
}

/* Specific widget colors on hover */
.ticker-widget-btn[data-widget="webmail"]:hover {
    background: rgba(52, 152, 219, 0.3);
}

.ticker-widget-btn[data-widget="greenie"]:hover {
    background: rgba(155, 89, 182, 0.3);
}

.ticker-widget-btn[data-widget="messenger"]:hover {
    background: rgba(0, 132, 255, 0.3);
}

.ticker-widget-btn[data-widget="whatsapp"]:hover {
    background: rgba(37, 211, 102, 0.3);
}

/* ========================================
   TICKER TITLE & NAVIGATION
   ======================================== */
.ticker-title-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    z-index: 10;
    position: relative;
}

.news-ticker-title {
    font-size: 0.85rem;
    font-weight: 800;
    margin: 0;
    padding-right: 14px;
    border-right: 2px solid rgba(255, 255, 255, 0.25);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.news-ticker-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.news-ticker-nav::-webkit-scrollbar {
    display: none;
}

.news-ticker-nav-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.news-ticker-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.news-ticker-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.news-ticker-nav-item:hover::before {
    opacity: 1;
}

.news-ticker-nav-item.active {
    color: #2c8e3e;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.3);
}

.news-ticker-nav-item.active::before {
    display: none;
}

/* ========================================
   RIGHT WIDGETS - Time/Weather, Social
   ======================================== */
.ticker-widgets-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

.ticker-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#ticker-date-time {
    font-weight: 600;
}

#ticker-weather {
    display: flex;
    align-items: center;
    gap: 4px;
}

#ticker-weather i {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ticker-separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

/* Social media icons group */
.ticker-social {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    color: #ffffff !important;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.ticker-social-icon:hover {
    transform: translateY(-2px) scale(1.1);
    filter: brightness(1.2);
}

.ticker-social-icon[data-platform="facebook"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="facebook"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ticker-social-icon[data-platform="twitter"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="twitter"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ticker-social-icon[data-platform="instagram"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="instagram"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ticker-social-icon[data-platform="youtube"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="youtube"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ticker-social-icon[data-platform="tiktok"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="tiktok"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ticker-social-icon[data-platform="threads"] {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}
.ticker-social-icon[data-platform="threads"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ========================================
   FADE OVERLAYS for smooth text fade in/out
   ======================================== */
.ticker-fade-left,
.ticker-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 3;
}

.ticker-fade-left {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.08), transparent);
}

.ticker-fade-right {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.08), transparent);
}

/* ========================================
   TICKER CONTENT - Scrolling news items
   ======================================== */
.news-ticker-content {
    position: relative;
    width: 100%;
    min-width: 100%;
    height: 100%;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.ticker-section {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 100%;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.ticker-section.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.ticker-items {
    display: inline-flex; /* size to content for precise scroll distance */
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll var(--ticker-duration, 60s) linear infinite;
    gap: 60px;
    transform: translateX(var(--ticker-start, 100vw));
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: auto;
    opacity: 1;
    text-shadow: 
        -1px -1px 0 rgba(0, 0, 0, 0.3),
        1px -1px 0 rgba(0, 0, 0, 0.3),
        -1px 1px 0 rgba(0, 0, 0, 0.3),
        1px 1px 0 rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.ticker-item::before {
    content: 'â—';
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ticker-item a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ticker-item a:hover {
    color: #ffd700;
    text-decoration: underline;
    text-shadow: 
        -1px -1px 0 rgba(0, 0, 0, 0.4),
        1px -1px 0 rgba(0, 0, 0, 0.4),
        -1px 1px 0 rgba(0, 0, 0, 0.4),
        1px 1px 0 rgba(0, 0, 0, 0.4),
        0 0 8px rgba(255, 215, 0, 0.5);
}

.ticker-item .time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(var(--ticker-start, 100vw));
    }
    100% {
        transform: translateX(var(--ticker-end, -100%));
    }
}

/* Pause animation on hover */
.ticker-items:hover {
    animation-play-state: paused;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
    .ticker-social {
        display: none;
    }
    
    .ticker-info {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

@media (max-width: 992px) {
    .news-ticker-container {
        width: 100% !important;
        max-width: 100% !important;
        left: 0;
        right: 0;
        margin: 0;
    }
    
    .ticker-top-row {
        height: 42px;
        min-height: 42px;
        padding: 4px 10px 3px;
        gap: 10px;
        width: 100%;
    }
    
    .ticker-scroller-row {
        height: 32px;
        min-height: 32px;
        margin: 0.35rem auto 0;
        padding: 0.2rem 0.6rem;
        width: calc(100% - 16px);
        border-radius: 999px;
    }
    
    .ticker-widget-btn {
        width: 32px;
        height: 32px;
    }
    
    .ticker-widget-btn i {
        font-size: 0.8rem;
    }
    
    .news-ticker-title {
        font-size: 0.8rem;
        padding-right: 12px;
    }
    
    .news-ticker-nav-item {
        padding: 4px 8px;
        font-size: 0.7rem;
        font-weight: 700;
    }
    
    .ticker-title-nav {
        flex: 1;
        min-width: 0;
    }
    
    #ticker-weather {
        display: none;
    }
}

@media (max-width: 768px) {
    .ticker-widgets-left {
        gap: 4px;
    }
    
    .ticker-widget-btn[data-widget="messenger"],
    .ticker-widget-btn[data-widget="greenie"] {
        display: none;
    }
    
    .news-ticker-title {
        display: none;
    }
    
    .ticker-info {
        font-size: 0.6rem;
        padding: 3px 6px;
        gap: 4px;
    }
    
    .ticker-separator {
        display: none;
    }
    
    .ticker-item {
        font-size: 0.68rem;
    }
}

@media (max-width: 576px) {
    .news-ticker-container {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        z-index: 900;
        overflow: visible;
    }
    
    .ticker-top-row {
        height: 40px;
        min-height: 40px;
        padding: 4px 8px 3px;
        width: 100%;
        gap: 6px;
    }
    
    .ticker-scroller-row {
        height: 30px;
        min-height: 30px;
        margin: 0.3rem auto 0;
        padding: 0.18rem 0.56rem;
        width: calc(100% - 10px);
        border-radius: 999px;
        display: flex !important;
    }
    
    .ticker-widget-btn {
        width: 28px;
        height: 28px;
    }
    
    .ticker-widget-btn i {
        font-size: 0.7rem;
    }
    
    .news-ticker-nav-item {
        padding: 3px 6px;
        font-size: 0.62rem;
        font-weight: 700;
    }
    
    .ticker-title-nav {
        flex: 1;
        overflow: hidden;
    }
    
    .ticker-info {
        display: none;
    }
    
    .ticker-item {
        font-size: 0.65rem;
        line-height: 1.2;
        padding: 0 12px;
    }
    
    .ticker-section {
        width: 100%;
    }
    
    .ticker-items {
        display: inline-flex !important;
    }
}

/* ========================================
   GRADIENT OVERLAYS for fade effect
   ======================================== */
.ticker-gradient-top,
.ticker-gradient-bottom {
    display: none; /* Not needed in new design */
}

.ticker-overlay-left,
.ticker-overlay-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    pointer-events: none;
    z-index: 3;
}

.ticker-overlay-left {
    left: 0;
    background: linear-gradient(to right, rgba(44, 95, 69, 1) 0%, transparent 100%);
}

.ticker-overlay-right {
    right: 0;
    background: linear-gradient(to left, rgba(44, 95, 69, 1) 0%, transparent 100%);
}

/* Subtle fades on top and bottom to blend into page */
.news-ticker-container::before,
.news-ticker-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    pointer-events: none;
    z-index: 950;
}

.news-ticker-container::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(44, 95, 69, 0.9), rgba(44, 95, 69, 0));
}

.news-ticker-container::after {
    bottom: -1px;
    background: linear-gradient(to top, rgba(39, 174, 96, 0.9), rgba(39, 174, 96, 0));
}
