/* Code Showcase Frontend Styles */
.code-showcase-container {
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: linear-gradient(145deg, #0f111a 0%, #0a0c14 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    position: relative;
}

/* Header Controls - Apple Style */
.code-showcase-header {
    background: linear-gradient(180deg, #1a1d2b 0%, #141723 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-showcase-controls {
    display: flex;
    gap: 8px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-dot.red {
    background: linear-gradient(135deg, #ff5f56 0%, #ff4943 100%);
    box-shadow: 0 2px 4px rgba(255, 95, 86, 0.3);
}

.control-dot.yellow {
    background: linear-gradient(135deg, #ffbd2e 0%, #ffa726 100%);
    box-shadow: 0 2px 4px rgba(255, 189, 46, 0.3);
}

.control-dot.green {
    background: linear-gradient(135deg, #27ca3f 0%, #28a745 100%);
    box-shadow: 0 2px 4px rgba(39, 202, 63, 0.3);
}

.control-dot:hover {
    transform: scale(1.1);
}

.code-showcase-actions {
    display: flex;
    gap: 10px;
}

.run-code-btn {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.run-code-btn:hover {
    background: linear-gradient(135deg, #0051d5 0%, #003d99 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.run-code-btn:active {
    transform: translateY(0);
}

/* Code Header with Copy Button */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.copy-code-btn svg {
    width: 12px;
    height: 12px;
}

/* Tabs */
.code-showcase-tabs {
    background: #0f111a;
}

.tab-buttons {
    display: flex;
    background: linear-gradient(180deg, #1a1d2b 0%, #141723 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: #8e8e93;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #007aff;
    background: rgba(0, 122, 255, 0.1);
}

/* HTML Tab */
.tab-btn[data-tab="html"] {
    color: #e34c26;
}

.tab-btn[data-tab="html"].active {
    border-bottom-color: #e34c26;
    background: rgba(227, 76, 38, 0.1);
}

/* CSS Tab */
.tab-btn[data-tab="css"] {
    color: #1572b6;
}

.tab-btn[data-tab="css"].active {
    border-bottom-color: #1572b6;
    background: rgba(21, 114, 182, 0.1);
}

/* JavaScript Tab */
.tab-btn[data-tab="js"] {
    color: #f7df1e;
}

.tab-btn[data-tab="js"].active {
    border-bottom-color: #f7df1e;
    background: rgba(247, 223, 30, 0.1);
}

/* Output Tab */
.tab-btn[data-tab="output"] {
    color: #28a745;
    display: none;
}

.tab-btn[data-tab="output"].active {
    border-bottom-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    display: flex;
}

.output-pane {
    background: #f8f9fa;
    padding: 0;
}

.tab-content {
    background: #0f111a;
    position: relative;
}

.tab-pane {
    display: none;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.tab-pane.active {
    display: block;
}

.tab-pane pre {
    margin: 0;
    padding: 15px;
    background: #0f111a;
    color: #d4d4d4;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.tab-pane code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: none !important;
    padding: 0 !important;
}

/* Output Section */
.output-iframe {
    width: 100%;
    height: 300px;
    border: none;
    background: white;
}

/* =========================================== */
/* Beautiful Theme Variations */
/* =========================================== */

/* Material Ocean Theme (Default) */
.code-showcase-container[data-theme="material-ocean"] {
    background: linear-gradient(145deg, #0f111a 0%, #0a0c14 100%);
    border: 1px solid rgba(139, 233, 253, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.code-showcase-container[data-theme="material-ocean"] .code-showcase-header {
    background: linear-gradient(180deg, #1a1d2b 0%, #141723 100%);
    border-bottom: 1px solid rgba(139, 233, 253, 0.2);
}

.code-showcase-container[data-theme="material-ocean"] .tab-buttons {
    background: linear-gradient(180deg, #1a1d2b 0%, #141723 100%);
    border-bottom: 1px solid rgba(139, 233, 253, 0.2);
}

.code-showcase-container[data-theme="material-ocean"] .tab-content,
.code-showcase-container[data-theme="material-ocean"] .tab-pane pre {
    background: #0f111a;
}

/* Dracula Theme */
.code-showcase-container[data-theme="dracula"] {
    background: linear-gradient(145deg, #282a36 0%, #1e2029 100%);
    border: 1px solid rgba(80, 250, 123, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.code-showcase-container[data-theme="dracula"] .code-showcase-header {
    background: linear-gradient(180deg, #343746 0%, #2a2c39 100%);
    border-bottom: 1px solid rgba(80, 250, 123, 0.2);
}

.code-showcase-container[data-theme="dracula"] .tab-buttons {
    background: linear-gradient(180deg, #343746 0%, #2a2c39 100%);
    border-bottom: 1px solid rgba(80, 250, 123, 0.2);
}

.code-showcase-container[data-theme="dracula"] .tab-btn {
    color: #bd93f9;
}

.code-showcase-container[data-theme="dracula"] .tab-btn:hover {
    color: #ffffff;
    background: rgba(80, 250, 123, 0.1);
}

.code-showcase-container[data-theme="dracula"] .tab-content,
.code-showcase-container[data-theme="dracula"] .tab-pane pre {
    background: #282a36;
}

/* Solarized Theme */
.code-showcase-container[data-theme="solarized"] {
    background: linear-gradient(145deg, #002b36 0%, #001f27 100%);
    border: 1px solid rgba(42, 161, 152, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.code-showcase-container[data-theme="solarized"] .code-showcase-header {
    background: linear-gradient(180deg, #073642 0%, #052c36 100%);
    border-bottom: 1px solid rgba(42, 161, 152, 0.3);
}

.code-showcase-container[data-theme="solarized"] .tab-buttons {
    background: linear-gradient(180deg, #073642 0%, #052c36 100%);
    border-bottom: 1px solid rgba(42, 161, 152, 0.3);
}

.code-showcase-container[data-theme="solarized"] .tab-btn {
    color: #b58900;
}

.code-showcase-container[data-theme="solarized"] .tab-btn:hover {
    color: #fdf6e3;
    background: rgba(42, 161, 152, 0.1);
}

.code-showcase-container[data-theme="solarized"] .tab-content,
.code-showcase-container[data-theme="solarized"] .tab-pane pre {
    background: #002b36;
    color: #839496;
}

/* Monokai Theme */
.code-showcase-container[data-theme="monokai"] {
    background: linear-gradient(145deg, #272822 0%, #1e1f1c 100%);
    border: 1px solid rgba(249, 38, 114, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.code-showcase-container[data-theme="monokai"] .code-showcase-header {
    background: linear-gradient(180deg, #3e3d32 0%, #2f2e24 100%);
    border-bottom: 1px solid rgba(249, 38, 114, 0.2);
}

.code-showcase-container[data-theme="monokai"] .tab-buttons {
    background: linear-gradient(180deg, #3e3d32 0%, #2f2e24 100%);
    border-bottom: 1px solid rgba(249, 38, 114, 0.2);
}

.code-showcase-container[data-theme="monokai"] .tab-btn {
    color: #a6e22e;
}

.code-showcase-container[data-theme="monokai"] .tab-btn:hover {
    color: #f8f8f2;
    background: rgba(249, 38, 114, 0.1);
}

.code-showcase-container[data-theme="monokai"] .tab-content,
.code-showcase-container[data-theme="monokai"] .tab-pane pre {
    background: #272822;
    color: #f8f8f2;
}

/* Light Theme */
.code-showcase-container[data-theme="light"] {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.code-showcase-container[data-theme="light"] .code-showcase-header {
    background: linear-gradient(180deg, #ffffff 0%, #f1f3f4 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.code-showcase-container[data-theme="light"] .tab-buttons {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.code-showcase-container[data-theme="light"] .tab-btn {
    color: #6c757d;
}

.code-showcase-container[data-theme="light"] .tab-btn:hover {
    color: #212529;
    background: rgba(0, 0, 0, 0.05);
}

.code-showcase-container[data-theme="light"] .tab-content,
.code-showcase-container[data-theme="light"] .tab-pane pre {
    background: #ffffff;
    color: #212529;
}

.code-showcase-container[data-theme="light"] .code-header {
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.code-showcase-container[data-theme="light"] .code-header span {
    color: rgba(0, 0, 0, 0.6);
}

.code-showcase-container[data-theme="light"] .copy-code-btn {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
}

.code-showcase-container[data-theme="light"] .copy-code-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

/* Night Owl Theme */
.code-showcase-container[data-theme="night-owl"] {
    background: linear-gradient(145deg, #011627 0%, #010e1a 100%);
    border: 1px solid rgba(127, 156, 245, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.code-showcase-container[data-theme="night-owl"] .code-showcase-header {
    background: linear-gradient(180deg, #1a2a3a 0%, #12202e 100%);
    border-bottom: 1px solid rgba(127, 156, 245, 0.2);
}

.code-showcase-container[data-theme="night-owl"] .tab-buttons {
    background: linear-gradient(180deg, #1a2a3a 0%, #12202e 100%);
    border-bottom: 1px solid rgba(127, 156, 245, 0.2);
}

.code-showcase-container[data-theme="night-owl"] .tab-btn {
    color: #7f9cf5;
}

.code-showcase-container[data-theme="night-owl"] .tab-btn:hover {
    color: #d6deeb;
    background: rgba(127, 156, 245, 0.1);
}

.code-showcase-container[data-theme="night-owl"] .tab-content,
.code-showcase-container[data-theme="night-owl"] .tab-pane pre {
    background: #011627;
    color: #d6deeb;
}

/* Custom Scrollbar */
.tab-pane::-webkit-scrollbar {
    width: 8px;
}

.tab-pane::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.tab-pane::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.tab-pane::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .code-showcase-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .tab-buttons {
        padding: 0 15px;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-width: auto;
    }

    .tab-pane pre {
        padding: 12px;
        font-size: 13px;
    }

    .output-iframe {
        height: 250px;
    }

    .run-code-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .code-showcase-container {
        margin: 15px 0;
        border-radius: 8px;
    }

    .tab-buttons {
        padding: 0 10px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .tab-pane pre {
        padding: 10px;
        font-size: 12px;
    }

    .output-iframe {
        height: 200px;
    }

    .control-dot {
        width: 10px;
        height: 10px;
    }
}

/* Loading Animation */
.code-showcase-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.code-showcase-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}