/* Playground Custom Styles - Tailwind ile yapılamayan stiller */

/* ==================== ANIMATIONS ==================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    transition: 0.2s;
    border-radius: 20px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #8b5cf6;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* ==================== CODEMIRROR OVERRIDES ==================== */
#code-editor-container .CodeMirror {
    height: 100%;
    font-size: 14px;
}

/* ==================== CONSOLE STYLES ==================== */
#console-panel.collapsed #console-output,
#console-panel.collapsed #clear-console {
    display: none;
}
#console-panel.collapsed #console-chevron {
    transform: rotate(-90deg);
}

/* ==================== EMBED MODE ==================== */
body.embed-mode {
    background: white;
}
body.embed-mode #toolbar,
body.embed-mode #editor-panel,
body.embed-mode #console-panel,
body.embed-mode #panel-resizer {
    display: none !important;
}
body.embed-mode #playground-container {
    height: 100vh;
}
body.embed-mode #preview-panel {
    width: 100% !important;
    border: none;
}
body.embed-mode #preview-container {
    height: 100%;
}
body.embed-mode #preview-header {
    display: none;
}

/* ==================== EMBED MODAL ==================== */
.embed-modal {
    display: none;
}
.embed-modal.visible {
    display: flex;
}
.embed-modal-content {
    animation: modalSlideIn 0.3s ease;
}

/* ==================== DOWNLOAD MENU ==================== */
.download-menu {
    display: none;
}
.download-menu.visible {
    display: block;
}
.download-btn.recording {
    animation: pulse 1s infinite;
}

/* ==================== SHARE TOAST ==================== */
.share-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}
.share-toast.fade-out {
    animation: slideDown 0.3s ease forwards;
}

/* ==================== SHORTCUTS PANEL ==================== */
#shortcuts-panel {
    display: none;
}
#shortcuts-panel.visible {
    display: block;
}

/* ==================== NUMBER SLIDER POPUP ==================== */
.number-slider-popup {
    position: fixed;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}
.number-slider-popup.visible {
    display: flex;
}
.number-slider-popup .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.number-slider-popup .slider-value {
    color: #f1f5f9;
    font-family: 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
}
.number-slider-popup .slider-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    font-size: 18px;
}
.number-slider-popup .slider-close:hover {
    color: #f1f5f9;
}
.number-slider-popup .slider-range-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #64748b;
}
.number-slider-popup input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #334155;
    outline: none;
    cursor: pointer;
}
.number-slider-popup input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    transition: transform 0.1s;
}
.number-slider-popup input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.number-slider-popup input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
}

/* ==================== TOOLBAR INPUTS ==================== */
.toolbar-title-input,
.toolbar-desc-input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
}
.toolbar-title-input {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.toolbar-desc-input {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.toolbar-title-input:hover,
.toolbar-desc-input:hover {
    background: rgba(255, 255, 255, 0.1);
}
.toolbar-title-input:focus,
.toolbar-desc-input:focus {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.toolbar-title-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.toolbar-desc-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    #playground-container {
        flex-direction: column;
        height: calc(100vh - 52px);
    }
    #editor-panel,
    #preview-panel {
        width: 100% !important;
        height: 50%;
    }
    #panel-resizer {
        display: none;
    }
}
