/* CodeSnap Specific Styles */

/* CodeSnap Specific Styles */

main.container {
    padding-top: 120px;
    padding-bottom: 80px;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-icon-large {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--primary-glow);
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.codesnap-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Controls Sidebar */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

.controls-panel h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-row {
    display: flex;
    gap: 1rem;
}
.control-row .control-group {
    flex: 1;
}

.control-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.control-group textarea,
.control-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.control-group textarea:focus,
.control-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.control-group select option {
    background: var(--bg-card);
    color: #fff;
}

.control-group textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.switch-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Preview Pane */
.preview-panel {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    overflow: hidden;
    background: var(--bg-card); /* Fixed invalid variable */
}

.preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

/* The Element to Export */
.export-frame {
    /* Responsive sizing inside the preview */
    max-width: 100%;
    border-radius: 0; /* Backgrounds look better squared out unless they are images. But let's leave no border radius on the frame so it exports cleanly */
    transition: padding 0.2s ease, background 0.3s ease;
    display: inline-block;
}

/* Code Window */
.code-window {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
    overflow: hidden;
    min-width: 400px;
    max-width: 800px;
    transition: all 0.3s ease;
}

.code-window.solid-bg {
    background: #1e1e1e; /* Standard dark solid */
    backdrop-filter: none;
}

.window-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.mac-dots {
    display: flex;
    gap: 8px;
}

.mac-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.close { background-color: #ff5f56; }
.dot.minimize { background-color: #ffbd2e; }
.dot.maximize { background-color: #27c93f; }

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.window-body {
    padding: 1.5rem;
    overflow-x: auto;
}

.window-body pre {
    margin: 0;
    background: transparent !important; /* Override highlight.js bg */
    white-space: pre;
    overflow-x: visible; /* Let html-to-image capture it all */
}

.window-body code {
    font-family: 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: transparent !important;
}

/* Button Fixes */
#btn-export {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
}

/* Background Gradients */
.bg-aurora { background: linear-gradient(135deg, #c4b5fd 0%, #f9a8d4 50%, #fbcfe8 100%); }
.bg-ocean { background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%); }
.bg-sunset { background: linear-gradient(135deg, #fb923c 0%, #f43f5e 100%); }
.bg-cyberpunk { background: linear-gradient(135deg, #f0abfc 0%, #3b82f6 100%); }
.bg-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.bg-monochrome { background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%); }
.bg-transparent { background: transparent; }

/* Responsive */
@media (max-width: 900px) {
    .codesnap-workspace {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        position: static;
    }
}
