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

:root {
    --navy-900: #0a192f;
    --navy-800: #112240;
    --navy-700: #1d3557;
    --gold-400: #d4af37;
    --gold-500: #C5A059;
    --gold-600: #a67c00;
    --parchment-50: #FDFCF0;
    --parchment-100: #f5f0e1;
    --patriot-blue: #1E3A8A;
}

::-webkit-scrollbar {
    width: 0;
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
    width: 0;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#gatekeeper-modal {
    pointer-events: auto;
}

#gatekeeper-modal > div {
    pointer-events: auto;
}

#chat-wrapper.modal-active {
    pointer-events: none;
}

#chat-wrapper.modal-active main,
#chat-wrapper.modal-active header,
#chat-wrapper.modal-active #chat-container,
#chat-wrapper.modal-active .input-area-presidential {
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--navy-700) 25%, var(--navy-800) 50%, var(--navy-700) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-bubble {
    height: 60px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.skeleton-input {
    height: 48px;
    border-radius: 24px;
}

.situation-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.situation-btn:active {
    transform: scale(0.98);
}

.header-presidential {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
    border-bottom: 2px solid var(--gold-500);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.input-area-presidential {
    background: linear-gradient(0deg, var(--navy-800) 0%, var(--navy-900) 100%);
    border-top: 1px solid rgba(197, 160, 89, 0.3);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-600) 100%);
    color: var(--navy-900);
    font-weight: 600;
    border: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

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

.ai-bubble {
    background: var(--navy-700);
    border: 1px solid var(--gold-500);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.user-bubble {
    background: var(--patriot-blue);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.constitutional-bg {
    background: transparent;
    position: relative;
}

.safe-area-bottom {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}

.touch-manipulation {
    touch-action: manipulation;
}

.input-area-presidential {
    position: relative;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.chat-main-container {
    width: 100vw;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .chat-main-container {
        height: 100dvh;
    }
}

body.theme-light {
    --navy-900: #f8fafc;
    --navy-800: #e2e8f0;
    --navy-700: #cbd5e1;
    --gold-400: #b8860b;
    --gold-500: #a67c00;
    --gold-600: #8b6914;
    --parchment-50: #1e293b;
    --parchment-100: #334155;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: #1e293b !important;
}

body.theme-light .ai-bubble {
    background: var(--navy-700);
    border-color: var(--gold-500);
}

body.theme-light .user-bubble {
    background: #3b82f6;
}

body.theme-light .input-area-presidential {
    background: linear-gradient(0deg, var(--navy-800) 0%, var(--navy-900) 100%);
    border-top-color: rgba(139, 105, 20, 0.3);
}

body.theme-light #skeleton-loader {
    background: #f8fafc;
}

body.theme-light .skeleton {
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
}

body.theme-light #gatekeeper-modal {
    background: rgba(248, 250, 252, 0.95);
}

body.theme-light #gatekeeper-modal > div {
    background: #e2e8f0;
    border-color: var(--gold-500);
}

body.theme-light #gatekeeper-modal h2,
body.theme-light #gatekeeper-modal label,
body.theme-light #gatekeeper-modal p {
    color: #1e293b;
}

body.embed-mode .situation-room-header {
    display: none !important;
}

@media (max-width: 768px) {
    .input-area-presidential {
        padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
        margin-bottom: 0;
        position: sticky;
        bottom: 0;
        z-index: 1000;
    }
    
    .chat-main-container {
        height: 100dvh;
        height: calc(100vh - env(safe-area-inset-bottom));
    }
    
    @supports (height: 100dvh) {
        .chat-main-container {
            height: 100dvh;
        }
    }
    
    #chat-container {
        padding-bottom: 20px;
    }
}

.message-user {
    animation: slideInRight 0.3s ease-out;
}

.message-assistant {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gold-500);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
}

.sources-toggle {
    cursor: pointer;
    transition: color 0.2s;
    color: var(--gold-500);
}

.sources-toggle:hover {
    color: var(--gold-400);
}

.sources-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sources-content.expanded {
    max-height: 200px;
}

.file-item {
    transition: all 0.2s;
    border-radius: 8px;
}

.file-item:hover {
    background-color: rgba(197, 160, 89, 0.1);
    border-color: var(--gold-500);
}

.source-tag {
    background: var(--navy-700);
    border: 1px solid rgba(197, 160, 89, 0.3);
    color: var(--parchment-50);
}

input::placeholder {
    font-style: italic;
}

h1, h2, h3, .font-serif {
    font-family: 'Libre Baskerville', Georgia, serif;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
}

.mermaid-container {
    background: rgba(17, 34, 64, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.mermaid-container svg {
    max-width: 100%;
    height: auto;
}

.mermaid-fallback {
    background: rgba(17, 34, 64, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: #d4af37;
    white-space: pre-wrap;
}
