/* =============================================
   MODERN NEWS HEADER STYLES
   The Lanka TV - Professional Header Component
   ============================================= */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #0061ce;
    --primary-light: #3494ff;
    --primary-dark: #004a9f;
    --accent-color: #ac1c2c;
    --accent-dark: #8a1621;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6b7280;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 70px;
  }
  
  /* Reset and Base Styles */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: 'Noto Sans Sinhala', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }
  
  /* Prevent body scroll when nav is open on mobile */
  body.nav-open {
    overflow: hidden;
  }
  
  /* =============================================
     MAIN HEADER CONTAINER
     ============================================= */
  .main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .main-header.scroll-down {
    transform: translateY(-100%);
  }
  
  .main-header.scroll-up {
    box-shadow: var(--shadow-lg);
  }
  
  /* =============================================
     HEADER TOP SECTION
     ============================================= */
  .header-top {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-bottom: 3px solid var(--primary-dark);
    position: relative;
    overflow: hidden;
  }
  
  /* Subtle animated background pattern */
  .header-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background: 
      repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
      );*/
    pointer-events: none;
  }
  
  .header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
  }
  
  /* =============================================
     LOGO SECTION
     ============================================= */
  .logo-section {
    flex-shrink: 0;
  }
  
  .logo-link {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-decoration: none;
    transition: var(--transition-smooth);
  }
  
  .logo-link:hover {
    transform: scale(1.02);
  }
  
  .site-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    transition: var(--transition-smooth);
  }
  
  .logo-link:hover .site-logo {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  }
  
  .site-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .the-text {
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 2px;
  }
  
  .site-name {
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Poppins', 'Arial Black', sans-serif;
  }
  
  /* =============================================
     HEADER ACTIONS
     ============================================= */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .search-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
  }
  
  .search-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
  }
  
  .search-btn:active {
    transform: scale(0.95);
  }
  
  /* =============================================
     HAMBURGER MENU TOGGLE
     ============================================= */
  .menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    padding: 0;
  }
  
  .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
  }
  
  .menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition-smooth);
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
  
  /* =============================================
     NAVIGATION BAR
     ============================================= */
  .main-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
  }
  
  .nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition-smooth);
    border-radius: 8px;
  }
  
  .nav-link i {
    font-size: 1rem;
    transition: var(--transition-smooth);
  }
  
  .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
    border-radius: 3px 3px 0 0;
  }
  
  .nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 97, 206, 0.05);
  }
  
  .nav-link:hover i {
    transform: scale(1.1);
  }
  
  .nav-link:hover::before {
    width: 80%;
  }
  
  .nav-link:active {
    transform: scale(0.98);
  }
  
  /* =============================================
     NEWS TICKER
     ============================================= */
  .news-ticker {
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 3px solid var(--accent-dark);
    position: relative;
  }
  
  .news-ticker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
      rgba(0, 0, 0, 0.1) 0%, 
      transparent 10%, 
      transparent 90%, 
      rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
  }
  
  .ticker-label {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-right: 3px solid var(--accent-dark);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }
  
  .ticker-label i {
    animation: pulse 2s ease-in-out infinite;
  }
  
  @keyframes pulse {
    0%, 100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.7;
      transform: scale(1.2);
    }
  }
  
  .ticker-content {
    flex: 1;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
  }
  
  .ticker-content marquee {
    padding: 0 2rem;
  }
  
  .ticker-content a {
    color: white;
    text-decoration: none;
    transition: var(--transition-smooth);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
  }
  
  .ticker-content a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.5);
  }
  
  .ticker-separator {
    margin: 0 1.5rem;
    opacity: 0.6;
    font-weight: 700;
  }
  
  /* =============================================
     SEARCH POPUP OVERLAY
     ============================================= */
  .search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
  }
  
  .search-popup.active {
    opacity: 1;
    visibility: visible;
  }
  
  .search-popup-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: scale(0.9);
    transition: var(--transition-smooth);
  }
  
  .search-popup.active .search-popup-content {
    transform: scale(1);
  }
  
  .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--text-light);
    transition: var(--transition-smooth);
    background: var(--bg-light);
  }
  
  .close-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
  }
  
  .search-popup-content input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: var(--transition-smooth);
  }
  
  .search-popup-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 97, 206, 0.1);
  }
  
  .search-popup-content button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .search-popup-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 97, 206, 0.3);
  }
  
  .search-popup-content button:active {
    transform: translateY(0);
  }
  
  /* =============================================
     RESPONSIVE DESIGN
     ============================================= */
  
  /* Tablet Styles */
  @media screen and (max-width: 1024px) {
    .nav-container {
      gap: 0.25rem;
    }
    
    .nav-link {
      padding: 1rem;
      font-size: 0.9rem;
    }
    
    .nav-link span {
      display: none;
    }
    
    .nav-link i {
      font-size: 1.2rem;
    }
  }
  
  /* Mobile Styles */
  @media screen and (max-width: 768px) {
    .header-container {
      padding: 0.75rem 1rem;
    }
  
    .site-logo {
      width: 50px;
      height: 50px;
    }
  
    .the-text {
      font-size: 0.75rem;
    }
  
    .site-name {
      font-size: 1.5rem;
    }
  
    .search-btn {
      width: 40px;
      height: 40px;
      font-size: 1rem;
    }
  
    .menu-toggle {
      display: flex;
    }
  
    /* Mobile Navigation */
    .main-nav {
      position: fixed;
      top: var(--header-height);
      left: 0;
      width: 100%;
      height: calc(100vh - var(--header-height));
      background: white;
      transform: translateX(-100%);
      box-shadow: none;
      border-bottom: none;
      overflow-y: auto;
    }
  
    .main-nav.active {
      transform: translateX(0);
      box-shadow: var(--shadow-lg);
    }
  
    .nav-container {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: 1rem;
    }
  
    .nav-link {
      padding: 1.25rem 1.5rem;
      border-radius: 12px;
      margin-bottom: 0.5rem;
      justify-content: flex-start;
      background: var(--bg-light);
    }
  
    .nav-link span {
      display: inline;
    }
  
    .nav-link i {
      font-size: 1.2rem;
    }
  
    .nav-link::before {
      display: none;
    }
  
    .nav-link:hover {
      background: var(--primary-color);
      color: white;
    }
  
    /* Ticker adjustments */
    .ticker-label {
      padding: 0.65rem 1rem;
      font-size: 0.75rem;
    }
  
    .ticker-content {
      padding: 0.65rem 0;
      font-size: 0.85rem;
    }
  
    .ticker-content marquee {
      padding: 0 1rem;
    }
  
    .ticker-separator {
      margin: 0 1rem;
    }
  
    /* Search popup mobile */
    .search-popup-content {
      padding: 2rem 1.5rem;
      width: 95%;
    }
  }
  
  /* Small Mobile Styles */
  @media screen and (max-width: 480px) {
    .site-logo {
      width: 45px;
      height: 45px;
    }
  
    .the-text {
      font-size: 0.7rem;
    }
  
    .site-name {
      font-size: 1.3rem;
    }
  
    .ticker-label {
      padding: 0.5rem 0.75rem;
      font-size: 0.7rem;
    }
  
    .ticker-content {
      font-size: 0.8rem;
    }
  }
  
  /* Print Styles */
  @media print {
    .main-header {
      position: static;
      box-shadow: none;
    }
  
    .menu-toggle,
    .search-btn,
    .news-ticker {
      display: none;
    }
  
    .main-nav {
      display: none;
    }
  }