/* ===== MODERN PLAYGROUND INTERFACE ===== */

/* Hide sidebar on playground page */
.sidebar {
    display: none !important;
}

.sidebar-overlay {
    display: none !important;
}

.main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Style navigation links as buttons */
.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #e7e9ea !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.header-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.header-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.header-link i {
    font-size: 1rem;
}

/* Mode selector buttons */
.mode-selector {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    justify-content: center;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #e7e9ea;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-tab:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.mode-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.mode-tab i {
    font-size: 1.1rem;
}

.playground-unique-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    padding: 20px;
    gap: 20px;
}

/* Settings button styling */
.settings-btn,
.voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #e7e9ea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover,
.voice-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.voice-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.settings-btn i,
.voice-btn i {
    font-size: 1.1rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(15, 20, 50, 0.95), rgba(25, 30, 70, 0.95));
    backdrop-filter: blur(30px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.language-select {
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
}

.language-select:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.15));
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.language-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.15));
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #e7e9ea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 40px;
    white-space: nowrap;
}

.tool-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.tool-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2);
}

#runBtn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.6);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    min-width: 90px;
}

#runBtn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
}

#runBtn:active {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.vision-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: rgba(6, 182, 212, 0.5);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.vision-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
    border-color: rgba(6, 182, 212, 0.6);
}

.tool-btn i {
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* Editor Container */
.editor-container {
    display: flex;
    flex: 1;
    gap: 20px;
    min-height: 500px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(15, 23, 65, 0.8), rgba(20, 25, 70, 0.8));
    backdrop-filter: blur(25px);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.editor-panel:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.output-panel {
    flex: 0.8;
    display: none;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(15, 23, 65, 0.8), rgba(20, 25, 70, 0.8));
    backdrop-filter: blur(25px);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.output-panel.show {
    display: flex;
    border-color: rgba(16, 185, 129, 0.5);
}

.output-panel.show .panel-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    border-bottom-color: rgba(16, 185, 129, 0.2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
    border-bottom: 1.5px solid rgba(59, 130, 246, 0.2);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    transition: all 0.3s ease;
}

.panel-header i {
    margin-right: 10px;
    color: #3b82f6;
    font-size: 16px;
}

.editor-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.editor-wrapper,
.output-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.output-wrapper {
    padding: 20px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #fff;
    line-height: 1.6;
}

.output-wrapper::-webkit-scrollbar {
    width: 8px;
}

.output-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.output-wrapper::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.output-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Welcome Message */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.welcome-message i {
    font-size: 64px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message h3 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 10px;
}

.welcome-message p {
    font-size: 14px;
    max-width: 400px;
}

/* CodeMirror Custom Styling */
.CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: transparent !important;
}

.CodeMirror-gutters {
    background: rgba(0, 0, 0, 0.2) !important;
    border-right: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.CodeMirror-linenumber {
    color: rgba(255, 255, 255, 0.4) !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #667eea !important;
}

.CodeMirror-selected {
    background: rgba(102, 126, 234, 0.2) !important;
}

/* AI Panel */
.ai-panel {
    position: fixed;
    right: -400px;
    top: 60px;
    bottom: 0;
    width: 380px;
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(102, 126, 234, 0.3);
    transition: right 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.ai-panel.active {
    right: 0;
}

.ai-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.ai-panel-header i {
    color: #667eea;
    margin-right: 10px;
}

.close-ai-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-ai-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: rotate(90deg);
}

.ai-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-panel-content::-webkit-scrollbar {
    width: 6px;
}

.ai-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ai-panel-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.ai-welcome {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.ai-welcome i {
    font-size: 56px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-welcome h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
}

.ai-welcome p {
    font-size: 13px;
    line-height: 1.6;
}

.ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.ai-suggest-btn {
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}

.ai-suggest-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateX(5px);
}

.ai-suggest-btn i {
    margin-right: 10px;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .editor-container {
        flex-direction: column;
    }

    .ai-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 768px) {
    .playground-unique-content {
        padding: 15px;
        gap: 15px;
    }

    .toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
            border-bottom: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 12px 12px 0 0;
            gap: 12px;
            flex-wrap: wrap;
        }

        .toolbar-left,
        .toolbar-right {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

        .language-select {
            padding: 10px 14px;
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            min-height: 40px;
        }

        .tool-btn {
            padding: 10px 16px;
            font-size: 14px;
            font-weight: 500;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
            border: 1px solid rgba(59, 130, 246, 0.4);
            border-radius: 8px;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 40px;
            white-space: nowrap;
        }

        .tool-btn:hover {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35));
            border-color: rgba(59, 130, 246, 0.6);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
        }

        .tool-btn:active {
            transform: translateY(0);
        }

        .tool-btn#runBtn {
            background: linear-gradient(135deg, #3b82f6, #2563eb);
            border-color: #1d4ed8;
            color: white;
            font-weight: 600;
        }

        .tool-btn#runBtn:hover {
            background: linear-gradient(135deg, #2563eb, #1d4ed8);
            box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);

    .panel-header {
        padding: 12px 15px;
        font-size: 13px;
    }

    .output-wrapper {
        padding: 15px;
        font-size: 13px;
    }
}

/* Notification */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.notification.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.notification.error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    border: 1px solid rgba(245, 87, 108, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: #fff;
}

.loading-spinner i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e7e9ea;
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.simple-notification {
    animation: slideIn 0.3s ease;
}

/* ===== GEMINI-STYLE MOBILE OPTIMIZATIONS ===== */
@media (max-width: 500px) {
    body {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: 60px;
    }

    /* Header */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 12px !important;
        z-index: 100;
        background: var(--bg-primary);
    }

    .header-actions {
        display: none !important;
    }

    /* Mode Selector */
    .mode-selector {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        z-index: 99;
        padding: 8px 12px;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-subtle);
    }

    /* Chat Container */
    .chat-container {
        flex: 1;
        overflow-y: auto;
        padding-top: 110px;
        padding-bottom: 80px;
        -webkit-overflow-scrolling: touch;
    }

    /* Playground Specific */
    .playground-unique-content {
        padding: 10px;
        gap: 12px;
    }

    .toolbar {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tool-btn {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 20px;
        min-height: 44px;
    }

    .language-select {
        min-height: 44px;
        font-size: 14px;
    }

    .editor-container {
        flex-direction: column;
        border-radius: 16px;
    }

    .editor-pane,
    .output-pane {
        min-height: 200px;
    }

    .panel-header {
        padding: 12px;
        font-size: 14px;
    }

    .output-wrapper {
        padding: 12px;
        font-size: 14px;
    }

    /* CodeMirror Mobile */
    .CodeMirror {
        font-size: 14px !important;
    }

    /* Bottom Navigation */
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        background: var(--bg-primary) !important;
        border-top: 1px solid var(--border-subtle) !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        z-index: 1000 !important;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        color: var(--text-tertiary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
    }

    .bottom-nav .nav-item i {
        font-size: 20px;
    }

    .bottom-nav .nav-item.active {
        color: var(--primary-500);
    }

    /* Notification Mobile */
    .notification {
        bottom: 80px;
        right: 16px;
        left: 16px;
        font-size: 13px;
    }
}