/* ========================================
   NOM DE COOKIE - Main Stylesheet
   ======================================== */

/* ========================================
   RESET & BASE
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre, .content-box {
    font-family: 'Courier Prime', 'Courier New', monospace;
}

/* ========================================
   THEME - Dark (default) / Light
   ======================================== */

:root {
    /* Colors - Dark theme (default) */
    --color-bg: #1a1a1a;
    --color-bg-header: rgba(26, 26, 26, 0.9);
    --color-bg-card: rgba(40, 40, 40, 0.8);
    --color-text: #e0e0e0;
    --color-text-muted: #999999;
    --color-accent: #4a9eff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.4);
    
    /* Light theme values */
    --light-bg: #f5f5f5;
    --light-bg-header: rgba(255, 255, 255, 0.9);
    --light-bg-card: rgba(255, 255, 255, 0.8);
    --light-text: #333333;
    --light-text-muted: #666666;
    
    /* Spacing */
    --header-height: 60px;
    --footer-height: 40px;
    --max-width: 1200px;
}

/* Light theme */
body.light-theme {
    --color-bg: var(--light-bg);
    --color-bg-header: var(--light-bg-header);
    --color-bg-card: var(--light-bg-card);
    --color-text: var(--light-text);
    --color-text-muted: var(--light-text-muted);
}

/* ========================================
   HEADER
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--color-bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-text-muted);
    z-index: 100;
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
}

.header__logo {
    text-decoration: none;
}

.header__logo-text {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    padding-top: 0.5rem;
    color: var(--color-text);
}

.header__menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.header__menu-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    position: relative;
}

.header__menu-icon::before,
.header__menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    left: 0;
}

.header__menu-icon::before {
    top: -8px;
}

.header__menu-icon::after {
    top: 8px;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header__nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.header__nav-link {
    color: var(--color-text);
    font-weight: bold;
    font-size: 0.95rem;
}

.header__nav-link:hover {
    text-decoration: none;
    opacity: 0.8;
}

.header__theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: var(--color-bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--color-text-muted);
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.footer-eyes-inline {
    height: 0.5em;
    width: auto;
    vertical-align: middle;
    margin: 0 0.05em;
}

body.light-theme .footer {
    background-color: rgba(0, 0, 0, 0.6);
    border-top: none;
}

body.light-theme .footer p {
    color: #e0e0e0;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* ========================================
   SHARED COMPONENTS
   ======================================== */

.content-box {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--color-text-muted);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    word-wrap: break-word;
}

body.light-theme .content-box {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ========================================
   MESSAGES PAGE
   ======================================== */

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filters__search,
.filters__select {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-text-muted);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
}

.filters__search {
    flex: 1;
    min-width: 200px;
}

.filters__search:focus,
.filters__select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Count */
.count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.count span {
    font-weight: bold;
}

/* Messages container */
.messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message card */
.message {
    background-color: var(--color-bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.message:hover {
    box-shadow: var(--shadow-hover);
}

/* Message header - sender on left, channel/time on right */
.message__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.message__from {
    font-size: 1.1rem;
    color: var(--color-text);
}

.message__top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.message__time {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Message meta - channel and preset */
.message__meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.message__channel,
.message__preset {
    padding: 0.1rem 0.4rem;
}

.message__hops {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* Load more button */
.load-more {
    display: block;
    margin: 1rem auto;
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-text-muted);
    border-radius: 8px;
    padding: 0.5rem 2rem;
    cursor: pointer;
}

.load-more:hover {
    border-color: var(--color-accent);
}

/* Loading/empty/error states */
.messages__loading,
.messages__empty,
.messages__error {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.messages__error {
    color: #e74c3c;
}

/* ========================================
   RESPONSIVE - Mobile
   ======================================== */

@media (max-width: 768px) {
    .header__menu-toggle {
        display: block;
    }
    
    .header__nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-bg-header);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 1rem;
        border-bottom: 1px solid var(--color-text-muted);
    }
    
    .header__nav.active {
        display: flex;
    }
    
    .header__nav-list {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header__nav-link {
        display: block;
        padding: 0.5rem 0;
    }
    
    .header__theme-toggle {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .header__logo-text {
        font-size: 2rem;
        padding-top: 0.25rem;
    }
    
    .header.menu-open {
        border-bottom: none;
    }
    
    .main {
        padding: 0.5rem;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters__search {
        width: 100%;
    }
}
