:root {
    --gold: #E5C158;
    --gold-gradient: linear-gradient(135deg, #F9D976 0%, #E5C158 50%, #996515 100%);
    --gold-glow: rgba(229, 193, 88, 0.4);
    --black: #050505;
    --deep-black: #000000;
    --glass: rgba(15, 15, 15, 0.7);
    --glass-border: rgba(229, 193, 88, 0.3);
    --accent-glow: radial-gradient(circle at center, rgba(229, 193, 88, 0.15) 0%, transparent 70%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--deep-black);
    color: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.neural-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        var(--accent-glow),
        radial-gradient(circle at 20% 30%, rgba(229, 193, 88, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(229, 193, 88, 0.05) 0%, transparent 40%),
        #000;
}

/* Glassmorphism Container */
.glass-container {
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    background: var(--glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 80px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(229, 193, 88, 0.05);
    position: relative;
    overflow: hidden;
    animation: float-container 6s ease-in-out infinite;
}

@keyframes float-container {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

header {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-badge {
    font-size: 0.6rem;
    color: var(--gold);
    letter-spacing: 2px;
    font-weight: 600;
    opacity: 0.8;
    border-top: 1px solid var(--glass-border);
    padding-top: 5px;
}

.logo {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 8px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    filter: drop-shadow(0 0 10px var(--gold-glow));
    animation: shimmer-text 3s infinite linear;
}

@keyframes shimmer-text {
    0% { filter: drop-shadow(0 0 10px var(--gold-glow)) brightness(1); }
    50% { filter: drop-shadow(0 0 20px var(--gold-glow)) brightness(1.2); }
    100% { filter: drop-shadow(0 0 10px var(--gold-glow)) brightness(1); }
}

.status {
    font-size: 0.8rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--gold);
    padding: 8px 15px;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.lang-switcher select:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px var(--gold-glow);
}

.lang-switcher select option {
    background: var(--black);
    color: white;
}

/* RTL Support */
body[dir="rtl"] {
    text-align: right;
}
body[dir="rtl"] .ai-message {
    align-self: flex-end;
}
body[dir="rtl"] .user-message {
    align-self: flex-start;
}
body[dir="rtl"] .input-area {
    flex-direction: row-reverse;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-message {
    text-align: center;
    margin-top: 50px;
}

.welcome-message h1 {
    font-weight: 300;
    font-size: 3rem;
    margin-bottom: 15px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.welcome-message p {
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Chat Bubbles */
.message {
    max-width: 70%;
    padding: 15px 25px;
    border-radius: 20px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.ai-message {
    align-self: flex-start;
    background: rgba(229, 193, 88, 0.03);
    border: 1px solid rgba(229, 193, 88, 0.2);
    border-radius: 0 25px 25px 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: message-fade-in 0.5s ease-out;
}

.user-message {
    align-self: flex-end;
    background: var(--gold-gradient);
    color: black;
    font-weight: 600;
    border-radius: 25px 25px 0 25px;
    box-shadow: 0 10px 30px rgba(229, 193, 88, 0.1);
    animation: message-fade-in 0.5s ease-out;
}

@keyframes message-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer & Input */
footer {
    padding: 30px;
    background: rgba(0,0,0,0.3);
}

.input-area {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(229, 193, 88, 0.1);
    padding: 18px 30px;
    border-radius: 20px;
    color: white;
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
}

input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(229, 193, 88, 0.1);
}

button {
    background: var(--gold-gradient);
    border: none;
    padding: 12px 30px;
    border-radius: 15px;
    color: black;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(229, 193, 88, 0.2);
}

button:hover {
    background: #fff;
    transform: translateY(-2px);
}

.voice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--gold);
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.voice-btn svg {
    width: 24px;
    fill: currentColor;
}

.voice-btn.recording {
    background: red;
    border-color: red;
    color: white;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Toggle Switch */
.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--gold);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

#mode-selector {
    background: rgba(229, 193, 88, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
}

#mode-selector:hover {
    background: rgba(229, 193, 88, 0.2);
    box-shadow: 0 0 10px var(--gold-glow);
}

.suggestion-btn {
    transition: transform 0.2s, background 0.3s;
}

.suggestion-btn:hover {
    transform: scale(1.05);
    background: #fff !important;
}

/* Mobile Optimization v55 */
@media (max-width: 768px) {
    body {
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        padding: 10px;
    }

    .glass-container {
        width: 100%;
        height: 100%;
        border-radius: 20px;
        animation: none; /* Disable floating on mobile to save battery and reduce jitter */
    }

    header {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.5rem;
        letter-spacing: 4px;
    }

    .header-right {
        gap: 10px;
    }

    .lang-switcher select {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .status {
        font-size: 0.7rem;
    }

    main {
        padding: 15px;
        gap: 15px;
    }

    .welcome-message {
        margin-top: 20px;
    }

    .welcome-message h1 {
        font-size: 1.8rem;
    }

    .welcome-message p {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .message {
        max-width: 90%;
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    footer {
        padding: 15px;
    }

    .input-area {
        gap: 8px;
    }

    input {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    button {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .voice-btn {
        width: 50px;
        height: 50px;
    }

    .controls {
        font-size: 0.7rem;
        gap: 10px;
    }
}
