/* /static/theme.css */

/* This file centralizes all color and style variables for the application. */

:root {
    /* Base Theme: Black & Grey */
    --bg-main: #000000; /* Pure Black Background */
    --bg-card: #121212;
    --bg-component: rgba(18, 18, 18, 0.7); /* Slightly transparent component background */
    --bg-input: #1D1D1D;
    --bg-header: rgba(18, 18, 18, 0.5);
    --editor-bg: #1e1e1e;

    --text-primary: #F5F5F5;
    --text-secondary: #A0A0A0;

    /* Accent colors are updated by theme-manager.js */
    --accent-color: #007BFF;
    --accent-color-hover: #3395FF;

    --border-color-opaque: #2a2a2a;
    --border-color-accent: rgba(0, 123, 255, 0.4);

    --glow-color: rgba(0, 123, 255, 0.6);

    --success-color: #00C49A;
    --danger-color: #FF6B6B;
}

/* Base and Layout Styles */
html, body {
    font-family: 'Nunito', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
}
html { height: 100%; }
body { min-height: 100%; }


/* Component Styling using CSS Variables */

.glass-header {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color-opaque);
}

#profile-menu {
    background-color: rgba(28, 28, 28, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color-opaque);
}

.settings-card, .card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-opaque);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-height: 148px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.settings-card:hover, .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--border-color-accent);
}

/* Button Styles */
.btn {
    border-radius: 1.5rem;
    transition: all 0.2s ease;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
}
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--glow-color);
    border: 1px solid transparent;
}
.btn-primary:hover {
    background-color: var(--accent-color-hover);
    box-shadow: 0 0 25px var(--glow-color);
}
.btn-primary:disabled {
    background-color: #2a2a2a;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary, .btn-outline {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}
.btn-secondary:hover, .btn-outline:hover {
    background-color: var(--glow-color);
    color: white;
    box-shadow: 0 0 15px var(--glow-color);
}


/* FIX: Updated dropdown styles for consistent UI */
.input-field, #project-selector-dropdown {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color-opaque);
    padding: 0.75rem 1rem;
    border-radius: 1.5rem;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23A0A0A0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}
.input-field:focus, #project-selector-dropdown:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--glow-color);
}

/* Icons that should match the accent color */
.accent-icon, .fa-flutter, #github-settings-card .fa-github {
    color: var(--accent-color);
    transition: color 0.3s ease;
}

/* Active states for navigation, buttons, etc. */
.project-list-item.active, .device-option-btn.active, #profile-menu a.active {
    background-color: var(--accent-color);
    color: white;
}
.device-option-btn.active {
     box-shadow: 0 0 10px var(--accent-color);
}

/* Toggle switch */
input:checked + .slider { background-color: var(--accent-color); }
.peer:focus:ring-4 { --tw-ring-color: var(--glow-color) !important; }
.peer:checked { background-color: var(--accent-color) !important; }

/* --- Project View Specific Styles --- */

/* Project List Panel */
#project-list-panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color-opaque);
    width: 280px; flex-shrink: 0;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    transform: translateX(-100%); /* Hidden by default */
}
#project-list-panel.sidebar-visible { transform: translateX(0); }
#add-new-project-btn { border-radius: 1.5rem; }

.project-list-item-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.project-list-item-container > a {
    flex-grow: 1;
    min-width: 0;
}
.project-list-item-container > button {
    flex-shrink: 0;
}

.custom-scrollbar::-webkit-scrollbar { width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--bg-main); }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: #2a2a2a; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: #4a4a4a; }


/* Chat UI */
.chat-bubble { max-width: 80%; width: fit-content; padding: 0.75rem 1rem; border-radius: 1rem; line-height: 1.6; margin-bottom: 1rem; }
.chat-bubble.user {
    background-color: var(--accent-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}
.chat-bubble.assistant {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color-opaque);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
}
.chat-bubble.assistant .mockup-proposal {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color-accent);
}
.chat-bubble code { background-color: rgba(0,0,0,0.3); padding: 0.2em 0.4em; margin: 0; font-size: 85%; border-radius: 3px; font-family: 'JetBrains Mono', monospace;}
.chat-bubble pre { background-color: var(--editor-bg); padding: 1rem; border-radius: 0.5rem; overflow-x: auto; }

.thinking .dot-flashing { position: relative; width: 10px; height: 10px; border-radius: 5px; background-color: var(--accent-color); color: var(--accent-color); animation: dot-flashing 1s infinite linear alternate; animation-delay: .5s; }
.thinking .dot-flashing::before, .thinking .dot-flashing::after { content: ''; display: inline-block; position: absolute; top: 0; }
.thinking .dot-flashing::before { left: -15px; width: 10px; height: 10px; border-radius: 5px; background-color: var(--accent-color); animation: dot-flashing 1s infinite alternate; animation-delay: 0s; }
.thinking .dot-flashing::after { left: 15px; width: 10px; height: 10px; border-radius: 5px; background-color: var(--accent-color); animation: dot-flashing 1s infinite alternate; animation-delay: 1s; }
@keyframes dot-flashing { 0% { background-color: var(--accent-color); } 50%, 100% { background-color: var(--border-color-accent); } }


.chat-input-wrapper { position: relative; display: flex; align-items: center; background-color: var(--bg-input); border-radius: 0.75rem; padding: 0.5rem 0.75rem 0.5rem 1.25rem; border: 1px solid var(--border-color-opaque); }
#chat-input { flex-grow: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-size: 1rem; resize: none; max-height: 150px; }
#chat-send-btn {
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
#chat-send-btn:disabled { background-color: #333; cursor: not-allowed; }

#quick-replies-container { min-height: 36px; transition: opacity 0.3s ease; }
.quick-reply-btn {
    background-color: var(--bg-input); /* Default background for mobile */
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    transform: translateY(10px);
    animation: fade-in-up 0.3s forwards;
}
.quick-reply-btn:hover {
    background-color: var(--accent-color);
    color: white;
}
@keyframes fade-in-up { to { opacity: 1; transform: translateY(0); } }

.pulsate-glow { animation: pulsate-glow 2s infinite ease-in-out; }
@keyframes pulsate-glow {
    0% { box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color); }
    50% { box-shadow: 0 0 20px var(--glow-color), 0 0 30px var(--glow-color); }
    100% { box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color); }
}

#resizer {
    flex-shrink: 0;
    background-color: transparent;
    width: 10px;
    cursor: col-resize;
    z-index: 20;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
#resizer:hover, #resizer.resizing { background-color: var(--accent-color); }
#resizer::before { content: ''; position: absolute; width: 2px; height: 32px; background-color: rgba(255, 255, 255, 0.2); border-radius: 1px; transition: background-color 0.2s; }
#resizer:hover::before, #resizer.resizing::before { background-color: white; }

/* Simulator Styles */
circle[id^="progress-ring-"],
#simulator-progress-ring {
    color: var(--accent-color);
    transition: color 0.3s ease;
}
.simulator-container { flex-grow: 1; display: flex; align-items: center; justify-content: center; position: relative; width: 100%; min-height: 0; }
#simulator-frame { position: relative; transition: all 0.3s ease-in-out; background: #111; box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1); display: flex; justify-content: center; align-items: center; flex-shrink: 0; transform-origin: center center; }
#simulator-frame.web { border-radius: 0.5rem; border: 1px solid var(--border-color-opaque); background: var(--bg-main); }
#simulator-frame.android, #simulator-frame.ios { border: 14px solid #111; border-radius: 54px; overflow: hidden; }
#simulator-frame iframe { border-radius: 40px; }
#simulator-frame.ios::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 160px; height: 30px; background: #111; border-bottom-left-radius: 18px; border-bottom-right-radius: 18px; z-index: 2; }

.device-selector-group { display: flex; gap: 0.25rem; padding: 0.5rem; background-color: var(--bg-input); border-radius: 9999px; border: 1px solid var(--border-color-opaque); align-items: center; }
.device-option-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; color: var(--text-secondary); background-color: transparent; border: none; cursor: pointer; }
.device-option-btn:hover:not(.active) { color: var(--text-primary); background-color: rgba(255, 255, 255, 0.1); }
#share-btn:disabled { color: #555; cursor: not-allowed; }
#share-btn:disabled:hover { background-color: transparent; }


/* Universe Page Styles */
.mockup-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color-opaque);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}
.mockup-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--glow-color);
    border-color: var(--border-color-accent);
}
.mockup-preview { height: 250px; background-color: var(--bg-main); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.mockup-preview iframe { width: 100%; height: 100%; transform: scale(0.75); transform-origin: center; border: none; pointer-events: none; }


/* --- NEW THEME STYLES --- */

@media (min-width: 1024px) {
    #quick-replies-container .quick-reply-btn {
        background-color: var(--bg-main);
    }
    #chat-panel {
        margin: 1rem;
        height: calc(100% - 2rem);
        border: 1px solid var(--border-color-accent);
        border-radius: 1.5rem 1.5rem 0.75rem 0.75rem;
        box-shadow: 0 0 25px var(--glow-color);
        background-color: var(--bg-card);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    #chat-history-container {
        flex-grow: 1;
    }

    #chat-panel > .flex-shrink-0 {
        padding: 0;
        background-color: var(--bg-input);
        border-top: 1px solid var(--border-color-accent);
        border-bottom-left-radius: 0.75rem;
        border-bottom-right-radius: 0.75rem;
    }

    #chat-input-wrapper {
        border: none;
        background-color: transparent;
        border-radius: 0;
        padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    }
}

#resizer::before {
    width: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}
