/* Grilles et layouts responsives */

/* ========== FONTS ========== */

/* HEADER & NAVIGATION */
.interface-header {
  font-size: var(--font-size-header);
}

.status-bar, 
.nav-links, 
.nav-link,
.system-time,
.status-item {
  font-size: var(--font-size-header); /* Uniformité du header */
}

/* WINDOW HEADERS */
.window-header {
  font-size: var(--font-size-window-header);
}

/* Sous-éléments des headers séparés et plus petits */
.archive-counter,
.relay-status,
.playlist-header,
.history-header,
.history-status {
  font-size: var(--font-size-subheader);
}

/* STATION IDENTIFIERS */
.station-id,
.current-freq,
.station-title,
.station-title-wrapper,
.station-marker {
  font-size: var(--font-size-station-name);
}

/* FREQUENCY CONTROLS */
.frequency-button,
.frequency-icon {
  font-size: var(--font-size-button);
}

.frequency-menu,
.freq-option {
  font-size: var(--font-size-text);
}

.freq-details {
  font-size: var(--font-size-xs);
}

/* STATUS INDICATORS */
.signal-status,
.signal-text,
.listeners-indicator,
.listener-icon,
.status-indicator,
.status-dot {
  font-size: var(--font-size-status);
}

/* Connected signals avec même taille */
.listeners-count,
.listener-label {
  font-size: var(--font-size-status);
}

/* PLAYLIST & HISTORY */
/* PLAYLIST STATUS */
.playlist-header {
  font-size: var(--font-size-subheader);
  text-shadow: var(--glow-primary);
}

/* contenu interne */
.playlist-content,
.playlist-label,
.playlist-name,
.playlist-info,
.playlist-time {
  font-size: var(--font-size-playlistcontent);
}

/* TERMINAL */
.terminal-content,
.terminal-output,
.terminal-line,
.terminal-input,
#terminal-input,
.prompt {
  font-size: var(--font-size-terminal);
  line-height: var(--line-height-terminal);
}

/* CHAT */
.chat-content {
  font-size: var(--font-size-text);
}

/* BUTTONS & CONTROLS */
button,
.action-button,
.schedule-button,
.nav-button,
.close-button,
.mobile-menu-toggle,
.menu-icon,
.chat-fab,
.fab-icon,
.fab-label {
  font-size: var(--font-size-button);
}

/* ARCHIVES */
.archives-grid,
.archives-item,
.modal-image-container,
.modal-navigation,
.nav-counter {
  font-size: var(--font-size-sm);
}

.planetary-data-line {
  font-size: var(--font-size-terminal);
}

/* CONTACT CARDS */
.social-card,
.card-header,
.platform-name,
.card-content,
.content-wrapper,
.platform-desc {
  font-size: var(--font-size-text);
}

.content-title {
  font-size: var(--font-size-md);
}

/* ABOUT CONTENT */
.about-section {
  font-size: var(--font-size-text);
}

.section-title {
  font-size: var(--font-size-section-title);
}

.section-content p,
.section-content ul,
.section-content li {
  font-size: var(--font-size-text);
  line-height: var(--line-height-text);
  font-family: 'Share Tech Mono', monospace;
}

/* MODAL CONTENT */
.visual-modal,
.data-modal,
.schedule-modal,
.request-modal,
.fullscreen-modal {
  font-size: var(--font-size-text);
}

/* LOADING & BOOT SCREENS */
.loading-screen,
.redirect-text,     /* Ajouté pour les messages de redirection */
.redirect-overlay,  /* Ajouté pour les messages de redirection */
.boot-sequence,
.boot-content {
  font-size: var(--font-size-md);
}

.boot-text {
  font-size: var(--font-size-sm);
}

/* MOBILE MENU */
.mobile-nav,
.mobile-nav-item,
.nav-icon,
.nav-text {
  font-size: var(--font-size-button);
}

/* FOOTER */
.interface-footer,
.footer-status {
  font-size: var(--font-size-footer);
}

/* ========== LAYOUTS PRINCIPAUX ========== */

/* Container principal */
.main-container {
    width: 100%;
    min-height: 100vh;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    opacity: 1;
    transition: opacity var(--transition-slow);
    box-sizing: border-box;
    padding-top: calc(var(--space-lg)*4);
    padding-bottom: calc(var(--space-lg)*3);
}

/* Conteneur de logo */
.logo-container {
    text-align: center;
    padding: var(--space-xs) 0;
}

.main-logo {
    height: clamp(5rem, 10vw, 13.75rem);
    width: auto;
    filter: drop-shadow(0 0 0.625rem var(--text-primary));
    max-width: 280px;
    max-height: 210px;
}

.logo-link {
    display: inline-block;
    transition: transform var(--transition-normal);
}

/* Hover effect only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .logo-link:hover {
        transform: scale(1.02);
    }
}
 
/* Touch feedback for mobile */
.logo-link:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Header nav section - centered in LEFT corner like footer is centered in RIGHT corner */
.header-nav-section {
    position: absolute;
    bottom: var(--space-sm);
    left: 18%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    z-index: 3;
    top: 10%;
}

.logo-link-header {
    display: inline-block;
    transition: transform var(--transition-normal);
    line-height: 0;
}

/* Hover effect only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .logo-link-header:hover {
        transform: scale(1.05);
    }
}
 
/* Touch feedback for mobile */
.logo-link-header:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Logo size in header nav section */
.header-logo {
    height: clamp(2rem, 4vw, 3rem);
    width: auto;
    filter: drop-shadow(0 0 0.3rem var(--text-primary));
    max-height: 4rem;
    display: block;
}

/* Header */
.interface-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-xmd);
    padding-bottom: calc(var(--space-xmd) + 20px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: calc(var(--header-height) + 20px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 500;
    transition: all var(--transition-normal);
    /* background: var(--glass-bg); (old style)*/
    background:
    repeating-linear-gradient(
        0deg,
        rgba(0, 13, 26, 0.85),
        rgba(0, 13, 26, 0.85) 2px,
        rgba(20, 23, 36, 0.85) 2px,
        rgba(20, 23, 36, 0.85) 4px
    );
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: visible;
    
    /* trapeze elargi pour contenir les nav-links avec caractere | */
     mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 0,0 L 100,0 L 100,71.43 L 36,71.43 L 34,100 L 2,100 L 0,71.43 Z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 0,0 L 100,0 L 100,71.43 L 36,71.43 L 34,100 L 2,100 L 0,71.43 Z' fill='white'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.interface-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
    pointer-events: none;
    /* bordure SVG elargie pour correspondre au mask */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 100,71.43 L 36,71.43 L 34,100 L 2,100 L 0,71.43' fill='none' stroke='%23dee2e6' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Hover effects only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .interface-header:hover::before {
        /* bordure SVG au hover - meme forme elargie */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 100,71.43 L 36,71.43 L 34,100 L 2,100 L 0,71.43' fill='none' stroke='%2374ff95' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
        filter: drop-shadow(0 0 10px rgba(116, 255, 149, 0.3));
    }
 
    .interface-header:hover {
        box-shadow:
            var(--glass-shadow),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* fallback pour navigateurs sans support mask-image */
@supports not (mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E")) {
    .interface-header {
        /* utilise clip-path comme fallback */
        clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 20px),
            30% calc(100% - 20px),
            28% 100%,
            2% 100%,
            0 calc(100% - 20px)
        );
    }
}

.status-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 var(--space-sm);
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.nav-links {
    display: flex;
    gap: 1vw;
    position: relative;
    z-index: 501;
}

.status-item {
    display: flex;
    align-items: center;
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.system-time span {
    display: inline-block;
    width: 1ch;
    text-align: center;
}

/* ===== FOOTER METALHEART ASYMMETRIC STYLE ===== */

.interface-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm);
    padding-top: calc(var(--space-sm) + 20px);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    z-index: 500;
    transition: all var(--transition-normal);
    min-height: calc(var(--footer-height) + 20px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* background: var(--glass-bg); (old style)*/
    background:
    repeating-linear-gradient(
        0deg,
        rgba(0, 13, 26, 0.85),
        rgba(0, 13, 26, 0.85) 2px,
        rgba(20, 23, 36, 0.85) 2px,
        rgba(20, 23, 36, 0.85) 4px
    );
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    /* forme definie par SVG mask - utilise le meme viewBox que la bordure originale */
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1000 600' preserveAspectRatio='none'%3E%3Cpath d='M 0,200 L 700,200 L 720,0 L 980,0 L 1000,200 L 1000,600 L 0,600 Z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1000 600' preserveAspectRatio='none'%3E%3Cpath d='M 0,200 L 700,200 L 720,0 L 980,0 L 1000,200 L 1000,600 L 0,600 Z' fill='white'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.interface-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
    pointer-events: none;
    /* bordure SVG - memes coordonnees que le mask */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1000 600' preserveAspectRatio='none'%3E%3Cpath d='M 0,200 L 700,200 L 720,0 L 980,0 L 1000,200' fill='none' stroke='%23dee2e6' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Hover effects only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .interface-footer:hover::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1000 600' preserveAspectRatio='none'%3E%3Cpath d='M 0,200 L 700,200 L 720,0 L 980,0 L 1000,200' fill='none' stroke='%2374ff95' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
        filter: drop-shadow(0 0 10px rgba(116, 255, 149, 0.3));
    }
 
    .interface-footer:hover {
        box-shadow:
            var(--glass-shadow),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* fallback pour navigateurs sans support mask-image */
@supports not (mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E")) {
    .interface-footer {
        /* utilise clip-path comme fallback */
        clip-path: polygon(
            0 20px,
            70% 20px,
            72% 0,
            98% 0,
            100% 20px,
            100% 100%,
            0 100%
        );
    }
}

/* Footer status content */
.footer-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    position: absolute;
    left: 85%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Footer logo */
.footer-logo {
    height: 1.25rem;
    width: auto;
    vertical-align: middle;
    margin-right: var(--space-sm);
    filter: drop-shadow(0 0 0.125rem var(--theme-secondary));
}

/* Fenêtres de base (terminal, moniteur, etc.) */

.monitor-window,
.terminal-window,
.logo-window,
.chat-window,
.news-window,
.archives-window,
.contact-window,
.about-window {
    background: var(--bg-terminal);
    border: var(--border-thin) solid var(--window-border);
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
}

.chat-window .window-header .buttons-wrapper {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

/* Wrapper pour les boutons dans le chat */
.chat-window .window-header .buttons-wrapper {
    display: flex;
    flex-direction: row; /* S'assurer que l'ordre est de gauche à droite */
    gap: var(--space-xs);
    align-items: center;
}

/* Le titre prend tout l'espace disponible */
.chat-window .window-header > span:first-child {
    flex: 1;
}

/* Forcer l'ordre visuel des boutons */
.chat-window .window-header .buttons-wrapper .refresh-chat {
    order: 0; /* Premier (à gauche) */
}

.chat-window .window-header .buttons-wrapper .window-control.minimize {
    order: 1; /* Deuxième (à droite) */
    margin-left: 0 !important;
}

.archives-window,
.contact-window {
    flex: 1;
}

.window-header {
    background: var(--window-header-bg);
    color: var(--window-header-text);
    padding: var(--space-xs) var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.window-header > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* terminal, logo et chat */
.terminal-window,
.chat-window {
    height: 60vh;
}

/* logo-window */
.logo-window {
    height: auto;
    min-height: unset;
    display: flex;
    flex-direction: column;
}

/* Flex container */
.monitor-flex-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
    width: 100%;
}

/* Track History & Playlist containers */
.track-history-monitor,
.playlist-monitor {
    border: var(--border-thin) solid var(--window-border);
    background: transparent;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.playlist-monitor {
    padding: var(--space-md);
}

/* Faire apparaître le Playlist Status en premier */
.playlist-monitor {
  order: 0;
}

/* Faire apparaître le Track History en second */
.track-history-monitor {
  order: 1;
}

.history-header,
.playlist-header {
    padding: var(--space-xmd);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header {
    border-bottom: var(--border-thin) solid var(--window-border);
}

.playlist-header {
    color: var(--theme-primary);
}

/* Grilles pour archives et contacts */
.archives-grid,
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: var(--space-md);
    padding: var(--space-md);
    height: 100%;
    overflow-y: auto;
}

/* About sections layout */
.about-sections {
    padding: var(--space-md);
    overflow-y: auto;
    flex: 1;
}

.about-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

/* ========== LOGO WINDOW ========== */

/* logo container positioning */
.logo-container {
    text-align: center;
    padding: 0;
}

/* logo content area maintient un ratio 1:1 */
.logo-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

/* station logo video remplit le carre en preservant le ratio */
.station-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-md);
}

/* ========== NEWS WINDOW ========== */

/* news window specific styles */
.news-window {
    min-height: 5rem;
    height: 27rem;
}

.news-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.news-item {
    border: var(--border-thin) solid var(--window-border);
    padding: var(--space-sm);
    background: rgba(0, 13, 26, 0.3);
    transition: all var(--transition-fast);
}

/* Hover effect only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .news-item:hover {
        background: rgba(0, 13, 26, 0.5);
        border-color: var(--theme-primary);
        box-shadow: 0 0 0.5rem rgba(116, 255, 149, 0.2);
    }
}
 
/* Touch feedback for mobile */
.news-item:active {
    background: rgba(0, 13, 26, 0.4);
    transform: scale(0.99);
    transition: all 0.1s ease;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    gap: var(--space-sm);
}

.news-type {
    color: var(--theme-primary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-date {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.news-pin-icon {
    width: 1.125rem;
    height: 1.125rem;
    opacity: 0.7;
    filter: brightness(0) saturate(100%) invert(88%) sepia(26%) saturate(2037%) hue-rotate(74deg) brightness(104%) contrast(98%);
}

.news-title {
    color: var(--text-primary);
    font-size: var(--font-size-text);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.news-body {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    font-family: 'Share Tech Mono', monospace;
}

.news-badge {
    display: inline-block;
    padding: 0.125rem var(--space-xs);
    background: var(--theme-primary);
    color: var(--bg-terminal);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
    margin-left: var(--space-xs);
    animation: pulse 2s infinite;
}

.news-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-lg);
    font-size: var(--font-size-sm);
}

.news-content::-webkit-scrollbar {
    width: 0.375rem;
}

.news-content::-webkit-scrollbar-track {
    background: rgba(0, 13, 26, 0.5);
}

.news-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-color);
    border-radius: var(--radius-sm);
}

/* Scrollbar hover only on desktop with precise pointer */
@media (hover: hover) and (pointer: fine) {
    .news-content::-webkit-scrollbar-thumb:hover {
        background: var(--theme-secondary);
    }
}