/* --- 1. GLOBAL STYLES & LAYOUT --- */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    background: #0f0c29 url('/assets/images/bg.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- 2. NAVIGATION BAR --- */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.2rem 0;
    background: transparent !important;
    display: flex;
    justify-content: center;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

#top-nav .logo {
    text-decoration: none;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 2;
}

/* Centered Navigation Links */
#top-nav .nav-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

#top-nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#top-nav a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

#top-nav a:hover {
    opacity: 0.6;
}

/* --- 3. NEW CHAT BUTTON (Top Right) --- */
.new-chat-btn {
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1001 !important;
    
    /* Removed frame to match nav links */
    background: none !important;
    border: none !important;
    padding: 0 !important;
    
    color: #ffffff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    transition: opacity 0.2s !important;
}

.new-chat-btn:hover {
    opacity: 0.6 !important;
}

/* --- 4. MAIN CONTENT AREA --- */
#app-root {
    height: calc(100vh - 80px - 60px);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 0 20px;
    z-index: 5;
    box-sizing: border-box;
    overflow: hidden;
}

/* --- 5. BRANDING & HERO (Home) --- */
.branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

#text02 {
    font-family: 'Dela Gothic One', cursive;
    font-size: clamp(2rem, 8vw, 4.2rem);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    text-align: center;
}

#text14 {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    margin-top: 0.8rem;
    opacity: 0.9;
    text-align: center;
}

.separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 2rem auto;
    width: 100px;
}

/* --- 6. BUTTONS & ICONS --- */
.icons-component {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.icons-component svg {
    width: 35px !important;
    height: 35px !important;
    fill: #ffffff !important;
    margin: 0 15px;
    display: inline-block;
}

.buttons-component {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style: none;
    padding: 0;
}

.buttons-component li {
    width: 100%;
    max-width: 280px;
    margin-bottom: 1rem;
}

.buttons-component a,
.btn-calc {
    display: block;
    width: 100%;
    padding: 0.8rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.btn-calc {
    background: rgba(157, 0, 255, 0.5) !important;
    border: 1px solid rgba(157, 0, 255, 0.7) !important;
    margin-top: 20px;
}

.buttons-component a:hover,
.btn-calc:hover {
    background: rgba(157, 0, 255, 0.8) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(157, 0, 255, 0.4);
}

/* --- 7. CALCULATOR CARD (Slimmer & Responsive) --- */
.calc-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    /* Responsive sizing */
    width: 100%;
    max-width: 380px; /* Reduced from 500px to be much slimmer */
    padding: 25px;    /* Reduced padding to save space */
    
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    margin: 0 auto; /* Ensures horizontal centering */
}

.calc-title {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 700;
    font-size: 1.4rem; /* Slightly smaller title */
    text-align: center;
    margin-bottom: 1.5rem;
}

.centered-input {
    flex: 1;
    max-width: 180px; /* Slimmed down inputs */
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    padding: 0.6rem !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-size: 1rem;
}

.result-area {
    text-align: center; /* Centers all inline content like text and spans */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the breakdown and total-line blocks */
}

.result-breakdown p {
    margin: 8px 0;
    text-align: center;
}

.total-line {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 15px 0;
    color: #bc6ff1; /* Keeping that purple vibe */
}

.words-label {
    margin-top: 15px;
    opacity: 0.6;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#res-words {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    margin-top: 5px;
    line-height: 1.4;
    max-width: 90%;
}

/* Styling for the Clipboard Button */
.copy-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(168, 85, 247, 0.2); /* Subtle purple tint */
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    color: #e0e7ff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    width: 100%; /* Makes it easy to click on mobile */
    max-width: 200px;
}

.copy-btn:hover {
    background: rgba(168, 85, 247, 0.4);
    border-color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Success state when copied */
.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
}

/* Mobile Tweak for Calculator */
@media (max-width: 480px) {
    .calc-card {
        padding: 20px;
        max-width: 320px; /* Even smaller on tiny screens */
    }
    .total-line {
        font-size: 1.2rem;
    }
}
/* --- 8. CHAT INTERFACE --- */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* 2. The Chat View container needs to fill that height */
.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%; 
    width: 100%;
}

/* 3. The Messages Area is the ONLY part that should scroll */
.messages-area {
    flex: 1; /* This pushes the input bar to the bottom */
    overflow-y: auto;
    padding: 20px;
    width: 100%;           /* Added */
    max-width: 800px;      /* Matches .input-container */
    margin: 0 auto;        /* Centers it */
    box-sizing: border-box; /* Ensures padding doesn't add to width */
    display: flex;
    flex-direction: column;
    align-items: center;
}


.footer-area {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0 20px 0;
    width: 100%;
}

/* Specific styling for the footer area to keep it aligned with the chat */
.input-container {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 15px;
    align-items: center;
}

.message-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px;
    padding: 12px 15px;
    color: white;
    font-size: 1rem;
    outline: none;
    resize: none;
}

.radio-btn, .send-button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Prevents buttons from squishing */
}

/* Radio Button Styling (Left Side) */
.radio-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.radio-btn svg {
    width: 24px;
    height: 24px;
    fill: #19302b; /* Neon green to match your vibe */
}

.radio-btn:hover {
    background: rgba(0, 255, 204, 0.2);
    transform: scale(1.05);
}

/* Send Button Styling (Right Side) */
.send-button {
    background: rgba(188, 111, 241, 0.8);
}

.send-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Remove the 'Ready: songs loaded' text */
#track-info, .ready-msg {
    display: none !important;
}
/* Message Bubbles */
.message-wrapper { 
    display: flex; 
    flex-direction: column; 
    width: 100%; }
.message-wrapper.user { 
    align-items: flex-end; }
.message-wrapper.dude { 
    align-items: flex-start; }

.message {
    max-width: 80%; /* Slightly narrower for a more 'chat-like' feel */
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.message-wrapper.user .message {
    background: rgba(188, 111, 241, 0.2);
    border-color: rgba(188, 111, 241, 0.3);
    border-radius: 15px 15px 0 15px;
}

.message-wrapper.dude .message {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px 15px 15px 0;
}

.chat-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chat-input-area {
    /* Push the entire input area up to prevent overlapping the slogan */
    padding-bottom: 60px !important; 
    background: transparent !important;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ffcc; /* Neon green dot */
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffcc;
}

.footer-quote {
    text-align: center;          /* Centers the text horizontally */
    width: 100%;                 /* Ensures it spans the full width of the footer */
    margin: 10px 0 0 0;          /* Adds a little gap above the text */
    font-size: 0.85rem;          /* Keeps it subtle */
    color: rgba(255, 255, 255, 0.5); /* Dimmed white for a "mellow" look */
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}


/* --- GLOBAL FOOTER STYLES --- */
#radio-player {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* This keeps your new 280px rectangle centered */
    z-index: 2000;
}

.radio-pill-btn {
    /* 1. FORCE THE RECTANGLE SHAPE */
    display: block !important;
    width: 280px !important;      /* Match the max-width of Chat/Calculator */
    height: auto !important;
    padding: 0.8rem 0 !important; /* Vertical padding only, width is fixed */
    
    /* 2. ADJUST THE CORNERS */
    /* Change 50px to 12px for a modern rectangle, or 25px for a softer one */
    border-radius: 50px !important; 
    
    /* 3. MATCHING PROPERTIES FROM YOUR INSPECTOR */
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    
    /* 4. TEXT ALIGNMENT */
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.radio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    pointer-events: auto; /* Re-enables clicking for the button and text */
}


#radio-toggle:hover {
    background: rgba(0, 255, 204, 0.3) !important;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
}

#radio-toggle svg {
    width: 28px !important;
    height: 28px !important;
}

.footer-quote {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
    font-family: 'Source Sans Pro', sans-serif;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Helps readability on busy backgrounds */
}


#track-info {
    font-family: 'monospace';
    color: #00ffcc;
    font-size: 0.85rem;
}

/* --- 10. UTILS & ANIMATIONS --- */

.animate-slogan {
    animation: sloganFadeIn 2.5s ease-in-out forwards;
}

@keyframes sloganFadeIn {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}


.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Remove Number Arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* --- MOBILE NAVIGATION FIX --- */
@media (max-width: 768px) {
    /* 1. Stack the wrapper elements vertically */
    .nav-wrapper {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
        align-items: center;
    }

    /* 2. Reset absolute positioning so elements flow naturally */
    #top-nav .nav-container {
        position: static;
        transform: none;
        width: 100%;
    }

    #top-nav .logo {
        position: static;
        margin-bottom: 5px;
        font-size: 1.2rem;
    }

    /* 3. Stack the links vertically or tighten the row */
    #top-nav ul {
        flex-direction: row; /* Keep them in a row but tighter */
        justify-content: center;
        gap: 15px;
    }

    /* 4. Position the New Chat button below the links or in the corner */
    .new-chat-btn {
        position: static !important;
        transform: none !important;
        margin-top: 5px;
        font-size: 0.9rem !important;
    }

    /* 5. Adjust main app padding so it doesn't overlap the now-taller header */
    #app-root {
        padding-top: 120px !important;
    }
}

/* Styling the placeholder text */
.centered-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.85rem !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

/* Adjusting the input width to handle the longer placeholder text */
.centered-input {
    max-width: 260px !important; /* Increased from 180px to fit the text */
    padding-right: 40px !important; /* Space for the 'лв.' or '€' icon */
}

/* Ensure currency labels stay positioned correctly over the input */
.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px; /* Adjust this to control overall width */
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.currency-label {
    margin-left: -35px; /* Pulls the label inside the input area */
    z-index: 10;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none; /* Allows clicks to pass through to the input */
}