/* Designer Extension Styles
 * Combines:
 * - Atmosphere Corner (Slide Panel) - from media-quick-access
 * - Design Editor (Popup Window) - from atmosphere-corner
 */

/* ========================================================================
   ATMOSPHERE CORNER (Slide Panel from Right)
   ======================================================================== */

/* Edge Hover Trigger - Right Side */
.media-edge-trigger {
    position: fixed;
    top: 0;
    right: 0;
    width: 24px;
    height: 100vh;
    z-index: 9997;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block; /* Default visible */
}

/* Show edge trigger in classic mode */
body.atmosphere-classic-mode .media-edge-trigger {
    display: block !important;
}

.media-edge-trigger::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 10px;
    height: 280px;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(var(--accent-rgb), 0.3),
        var(--accent),
        rgba(var(--accent-rgb), 0.3),
        transparent
    );
    border-radius: 20px;
    opacity: 0.4;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.media-edge-trigger:hover {
    width: 28px;
}

.media-edge-trigger:hover::before {
    opacity: 1;
    width: 11px;
    height: 300px;
    animation: colorShift 3s ease-in-out infinite;
}

@keyframes colorShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(45deg);
    }
}

/* Main Panel - Slide from Right */
.media-quick-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 360px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        -20px 0 60px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.media-quick-panel.open {
    right: 0;
}

/* Toggle Button - Bottom Right Corner */
.media-quick-toggle {
    position: fixed;
    bottom: 19px;
    right: 24px;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    z-index: 9997;
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.media-quick-toggle .toggle-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

.media-quick-toggle .toggle-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.8));
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 2px;
}

.media-quick-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 25px rgba(var(--accent-rgb), 0.4);
    transform: translateY(-3px);
}

.media-quick-toggle:hover .toggle-text::after {
    width: 100%;
}

.media-quick-toggle::before {
    content: '';
    position: absolute;
    inset: -170%;
    background: linear-gradient(
        135deg,
        transparent 20%,
        rgba(var(--accent-rgb), 0.9) 50%,
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.media-quick-toggle:hover::before {
    opacity: 1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

/* Header */
.media-quick-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.02)
    );
    border-radius: 16px 16px 0 0;
}

.media-quick-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
}

.media-quick-close {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 26px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.media-quick-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.1);
}

/* Tabs Container */
.media-quick-tabs {
    display: flex;
    gap: 10px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 2x2 Grid for main tabs */
.media-quick-tabs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
}

/* Full width grid (no vertical button) */
.media-quick-tabs-grid-full {
    flex: none;
    width: 100%;
}

.media-quick-tab {
    flex: 1;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.media-quick-tab::before {
    content: '';
    position: absolute;
    inset: -100%;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        transparent 20%,
        var(--accent) 50%,
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.media-quick-tab:hover::before {
    opacity: 1;
    animation: rotateGradient 3s linear infinite;
}

@keyframes rotateGradient {
    to { transform: rotate(360deg); }
}

.media-quick-tab span:first-child {
    font-size: 22px;
}

/* Vertical Design Tab */
.media-quick-tab-vertical {
    flex: 0 0 50px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: auto;
    align-self: stretch;
    padding: 16px 8px;
    gap: 0;
    justify-content: center;
    letter-spacing: 1px;
}

.media-quick-tab.media-quick-tab-vertical span {
    display: inline;
    white-space: nowrap;
    font-size: 14px;
}

.media-quick-tab.media-quick-tab-vertical .design-icon {
    font-size: 20px;
}

.media-quick-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}

.media-quick-tab.active {
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.2),
        rgba(124, 58, 237, 0.1)
    );
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Content */
.media-quick-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
}

.media-quick-content::-webkit-scrollbar {
    width: 6px;
}

.media-quick-content::-webkit-scrollbar-track {
    background: transparent;
}

.media-quick-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.media-quick-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.media-quick-tab-content {
    display: none;
}

.media-quick-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid */
.media-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.media-quick-item {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.media-quick-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.media-quick-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

.media-quick-item-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-quick-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-quick-item-preview.no-bg {
    background: rgba(255, 255, 255, 0.03);
    flex-direction: column;
    gap: 8px;
}

.media-quick-item-preview.no-bg span {
    font-size: 24px;
    opacity: 0.6;
}

.media-quick-item-preview.youtube-preview {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(200, 0, 0, 0.1));
    flex-direction: column;
    gap: 8px;
}

.media-quick-item-preview.youtube-preview span {
    font-size: 28px;
}

.media-quick-item-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-quick-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    font-size: 14px;
    z-index: 1;
}

.media-quick-item:hover .media-quick-item-delete {
    opacity: 1;
}

.media-quick-item-delete:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Drag & Drop States */
.media-quick-item.holding {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10;
    animation: holdPulse 0.8s ease-in-out infinite;
}

@keyframes holdPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5), 0 0 0 3px rgba(124, 58, 237, 0.3); }
}

.media-quick-item.dragging {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--accent, #7c3aed);
    z-index: 10;
}

#galleryGrid.dragging-active .media-quick-item {
    transition: transform 0.2s ease;
}

/* Empty State */
.media-quick-empty {
    text-align: center;
    padding: 60px 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 15px;
    font-style: italic;
}

/* Upload Button */
.media-quick-upload-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.15),
        rgba(124, 58, 237, 0.1)
    );
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.media-quick-upload-btn span:first-child {
    font-size: 20px;
}

.media-quick-upload-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.25),
        rgba(124, 58, 237, 0.15)
    );
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

/* YouTube Input */
.media-youtube-input {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.media-youtube-input input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.media-youtube-input input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.media-youtube-input input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.media-youtube-btn {
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.media-youtube-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.3);
}

/* YouTube Controls */
.media-youtube-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.youtube-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.youtube-timeline-row {
    gap: 0;
}

.youtube-timeline-row .youtube-timeline-container {
    flex: 1;
    width: 100%;
}

.youtube-control-row:last-child {
    margin-bottom: 0;
}

.youtube-control-row label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    min-width: 80px;
}

.youtube-control-row input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.youtube-control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
    transition: transform 0.2s;
}

.youtube-control-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.youtube-control-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.youtube-control-row input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.youtube-control-row > span {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    min-width: 48px;
    text-align: right;
}

/* YouTube Fitting Select */
.youtube-fitting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.youtube-fitting-row label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    min-width: 60px;
}

.youtube-fitting-select {
    flex: 1;
    max-width: 180px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.youtube-fitting-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.youtube-fitting-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

.youtube-fitting-select option {
    background: #1a1a1a;
    color: white;
}

/* Timeline Container */
.youtube-timeline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.youtube-timeline-container input[type="range"] {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 4px;
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

.youtube-timeline-container input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.youtube-timeline-container input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.youtube-timeline-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: -4px;
    position: relative;
    z-index: 3;
}

.youtube-timeline-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 3;
}

.youtube-timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--accent), rgba(124, 58, 237, 0.6));
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.youtube-timeline-time {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
}

/* ========== Themes Tab Styles ========== */

.media-themes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.media-theme-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.media-theme-group.media-effects-compact {
    gap: 6px;
}

.media-theme-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-theme-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-theme-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    background: rgba(124, 58, 237, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Theme Select Dropdown */
.media-theme-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 32px;
}

.media-theme-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.media-theme-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
}

.media-theme-select option {
    background: #1e1e2e;
    color: rgba(255, 255, 255, 0.9);
    padding: 8px;
}

/* Theme Slider */
.media-theme-slider {
    width: 100%;
    height: 7px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05)
    );
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.media-theme-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.9),
        var(--accent)
    );
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 
        0 4px 12px rgba(124, 58, 237, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.media-theme-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 
        0 6px 20px rgba(124, 58, 237, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.media-theme-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.media-theme-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.9),
        var(--accent)
    );
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 
        0 4px 12px rgba(124, 58, 237, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.media-theme-slider::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* Theme Divider */
.media-theme-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    margin: 8px 0;
}

/* Theme Checkbox */
.media-theme-checkbox {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 10px 0;
    user-select: none;
}

.media-theme-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    flex-shrink: 0;
}

.media-theme-checkbox input[type="checkbox"]:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3);
}

.media-theme-checkbox input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.5);
}

.media-theme-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.media-theme-checkbox span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.media-theme-checkbox:hover span {
    color: rgba(255, 255, 255, 0.95);
}

/* Advanced Options Button */
.media-advanced-options-btn {
    width: 100%;
    margin-top: 4px;
}

.media-advanced-options-btn::before {
    inset: -160%;
}

/* Color Grid for Custom Colors */
.atmos-color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.atmos-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.atmos-color-item label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.atmos-color-item input[type="color"] {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    background: transparent;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmos-color-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.atmos-color-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
}

.atmos-color-item input[type="color"]:hover {
    transform: scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* Text Input */
.atmos-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s;
}

.atmos-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.atmos-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.3);
}

/* Saved Themes List */
.atmos-saved-themes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.atmos-saved-theme-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.atmos-saved-theme-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    transform: translateX(4px);
}

.atmos-saved-theme-preview {
    display: flex;
    gap: 4px;
}

.atmos-saved-theme-preview span {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.atmos-saved-theme-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.atmos-saved-theme-delete {
    width: 22px;
    height: 22px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.atmos-saved-theme-item:hover .atmos-saved-theme-delete {
    opacity: 1;
}

.atmos-saved-theme-delete:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.1);
}

/* Theme Type Toggle */
.atmos-theme-toggle {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 4px;
}

.atmos-theme-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmos-theme-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.atmos-theme-toggle-btn.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(124, 58, 237, 0.15));
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Theme Sections (show/hide) */
.atmos-theme-section {
    display: none;
    margin-top: 12px;
}

.atmos-theme-section.active {
    display: block;
}

/* 3-column grid for general colors */
.atmos-color-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4-column grid for text colors */
.atmos-color-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 5-column grid for text colors with main */
.atmos-color-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.atmos-color-grid-5 .atmos-color-item input[type="color"] {
    width: 40px;
    height: 40px;
}

/* Preset Save Row */
.atmos-preset-save-row {
    display: flex;
    gap: 8px;
}

.atmos-preset-save-row .atmos-input {
    flex: 1;
}

.atmos-btn-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmos-btn-icon:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(124, 58, 237, 0.3));
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* Saved Presets List */
.atmos-saved-presets {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    max-height: 140px;
    overflow-y: auto;
}

.atmos-preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.atmos-preset-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(124, 58, 237, 0.4);
}

.atmos-preset-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.05));
    border-color: var(--accent);
}

.atmos-preset-colors {
    display: flex;
    gap: 3px;
}

.atmos-preset-colors span {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.atmos-preset-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.atmos-preset-delete {
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 5px;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.atmos-preset-item:hover .atmos-preset-delete {
    opacity: 1;
}

.atmos-preset-delete:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}


/* ========================================================================
   DESIGN EDITOR (Popup Window)
   ======================================================================== */

/* Main Panel */
.atmosphere-corner {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    max-height: 100vh;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: 
        -20px 0 60px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s;
}

.atmosphere-corner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(
        ellipse at top,
        rgba(124, 58, 237, 0.15),
        transparent
    );
    pointer-events: none;
    border-radius: 0;
}

.atmosphere-corner.open {
    right: 0;
    opacity: 1;
    pointer-events: all;
}

.atmosphere-corner.dragged {
    transition: none !important;
}

/* Header */
.atmosphere-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.02)
    );
    flex-shrink: 0;
}

.atmosphere-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
}

.atmosphere-title span:first-child {
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.6));
}

.atmosphere-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmosphere-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.1);
}

/* Tabs */
.atmos-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.atmos-tab {
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.atmos-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}

.atmos-tab.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(124, 58, 237, 0.1));
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Content Area */
.atmosphere-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
}

.atmosphere-content::-webkit-scrollbar {
    width: 4px;
}

.atmosphere-content::-webkit-scrollbar-track {
    background: transparent;
}

.atmosphere-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Panels */
.atmos-panel {
    display: none;
    padding: 16px;
}

.atmos-panel.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Grid Layout */
.atmos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Control Groups */
.atmos-group {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmos-group:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.atmos-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.4));
}

/* Controls */
.atmos-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atmos-control label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.atmos-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.atmos-row label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.atmos-row span {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    background: rgba(124, 58, 237, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

/* Selects */
.atmos-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 45px;
}

.atmos-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.atmos-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.atmos-select option {
    background: #1e1e2e;
    color: rgba(255, 255, 255, 0.9);
}

/* Range Sliders */
.atmos-panel input[type="range"] {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    appearance: none;
}

.atmos-panel input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), var(--accent));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.atmos-panel input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.6);
}

.atmos-panel input[type="range"]::-moz-range-thumb {
    width: 21px;
    height: 21px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), var(--accent));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

/* Checkboxes */
.atmos-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.atmos-check input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.atmos-check input[type="checkbox"]:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.atmos-check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.atmos-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.atmos-check span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Card Grid (for Avatar options) */
.atmos-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.atmos-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmos-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.atmos-card.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.1));
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
}

.atmos-card-icon {
    font-size: 24px;
    line-height: 1;
}

.atmos-card-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ==========================================================================
   AVATAR CUSTOMIZATION STYLES
   ========================================================================== */

/* Avatar Shape Styles */
body.avatar-shape-round .message-avatar {
    border-radius: 50% !important;
}

body.avatar-shape-square .message-avatar {
    border-radius: 8px !important;
}

body.avatar-shape-portrait .message-avatar {
    border-radius: 12px !important;
    aspect-ratio: 3/4 !important;
    width: var(--avatar-size, 40px) !important;
    height: auto !important;
}

/* Avatar Border Style Styles */
body.avatar-border-colored .message-avatar {
    border: var(--avatar-border-width, 1px) solid var(--accent) !important;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3) !important;
}

body.avatar-border-colored .message-block.user .message-avatar {
    border-color: var(--accent-user) !important;
}

body.avatar-border-gray .message-avatar {
    border: var(--avatar-border-width, 1px) solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

body.avatar-border-glassmorphism .message-avatar {
    border: var(--avatar-border-width, 1px) solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 
        0 0 20px rgba(var(--accent-rgb), 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Avatar Size via CSS variable */
.message-avatar {
    width: var(--avatar-size, 40px) !important;
    height: var(--avatar-size, 40px) !important;
    min-width: var(--avatar-size, 40px) !important;
    min-height: var(--avatar-size, 40px) !important;
    display: var(--avatar-display, flex) !important;
}

/* Color Picker */
.atmos-panel input[type="color"] {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.atmos-panel input[type="color"]:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Buttons */
.atmos-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.atmos-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.atmos-btn.atmos-reset {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.9);
}

.atmos-btn.atmos-reset:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Hint Text */
.atmos-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    line-height: 1.3;
}

/* Value display */
.atmos-value {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    background: rgba(124, 58, 237, 0.1);
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .atmosphere-corner {
        width: 90%;
        max-height: 70%;
        left: 5% !important;
        right: auto;
    }
    
    .atmos-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS - ATMOSPHERE CORNER & DESIGN EDITOR
   ========================================================================== */

/* Large screens (1600px and below) */
@media (max-width: 1600px) {
    .media-quick-panel {
        width: 320px;
        right: -320px;
    }
    
    .media-quick-panel.open {
        right: 0;
    }
    
    .atmosphere-corner {
        width: 300px;
        right: -300px;
    }
    
    .atmosphere-corner.open {
        right: 0;
    }
    
    .media-quick-title {
        font-size: 20px;
    }
    
    .atmosphere-title {
        font-size: 16px;
    }
}

/* ==========================================================================
   ATMOSPHERE TOGGLE ARROW (Sidebar-style button for right side)
   ========================================================================== */

/* The button itself is full height for hover detection, but visually only shows at top */
.atmosphere-toggle-arrow {
    position: fixed;
    top: 0;
    z-index: 9998;
    width: 24px;
    height: 100vh;
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    cursor: pointer;
    background: transparent;
    border: none;
    box-shadow: none;
    /* CRITICAL: Use same transition as panel for perfect sync */
    transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmosphere-toggle-arrow.active {
    display: flex;
}

/* The visible part - only at top */
.atmosphere-toggle-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: var(--logo-height, 120px);
    /* Glassmorphism style like atmosphere panel */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        -2px 0 12px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.atmosphere-toggle-arrow .arrow-icon {
    position: relative;
    top: calc(var(--logo-height, 120px) / 2 - 9px);
    left: 3px;
    width: 18px;
    height: 18px;
    stroke: var(--accent);
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(var(--accent-rgb, 124, 58, 237), 0.4));
    z-index: 1;
}

/* ===== CLOSED STATE ===== */
.atmosphere-toggle-arrow:not(.panel-open) {
    right: 0;
}

.atmosphere-toggle-arrow:not(.panel-open)::before {
    opacity: 0.4;
}

.atmosphere-toggle-arrow:not(.panel-open) .arrow-icon {
    transform: scaleX(1);
    opacity: 0.4;
}

/* Hover when closed */
.atmosphere-toggle-arrow:not(.panel-open):hover::before {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(var(--accent-rgb, 124, 58, 237), 0.5),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-arrow:not(.panel-open):hover .arrow-icon {
    opacity: 1;
    stroke: white;
    transform: scaleX(1) translateX(-2px);
    filter: drop-shadow(0 0 8px var(--accent));
}

/* ===== OPEN STATE ===== */
.atmosphere-toggle-arrow.panel-open {
    right: 360px;
}

.atmosphere-toggle-arrow.panel-open::before {
    opacity: 1;
}

.atmosphere-toggle-arrow.panel-open .arrow-icon {
    transform: scaleX(-1);
    opacity: 1;
}

/* Hover when open */
.atmosphere-toggle-arrow.panel-open:hover::before {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(var(--accent-rgb, 124, 58, 237), 0.5),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-arrow.panel-open:hover .arrow-icon {
    stroke: white;
    transform: scaleX(-1) translateX(-2px);
    filter: drop-shadow(0 0 8px var(--accent));
}

/* Responsive adjustments for arrow toggle - must match panel widths exactly */
@media (max-width: 1600px) {
    .atmosphere-toggle-arrow.panel-open {
        right: 320px;
    }
}

@media (max-width: 1400px) {
    .atmosphere-toggle-arrow.panel-open {
        right: 300px;
    }
}

@media (max-width: 1200px) {
    .atmosphere-toggle-arrow.panel-open {
        right: 280px;
    }
}

@media (max-width: 1024px) {
    .atmosphere-toggle-arrow.panel-open {
        right: 260px;
    }
}

/* Hide edge trigger when arrow mode is active */
body.atmosphere-arrow-mode .media-edge-trigger {
    display: none !important;
}

/* Show arrow button when arrow mode is active */
body.atmosphere-arrow-mode .atmosphere-toggle-arrow {
    display: flex !important;
}

/* Hide arrow button when NOT in arrow mode */
body:not(.atmosphere-arrow-mode) .atmosphere-toggle-arrow {
    display: none !important;
}

/* ==========================================================================
   ATMOSPHERE TOGGLE ATMO (Vertical text button for right side - top position)
   ========================================================================== */

.atmosphere-toggle-atmo {
    position: fixed;
    top: 0;
    z-index: 9998;
    width: 28px;
    height: 100vh;
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    cursor: pointer;
    background: transparent;
    border: none;
    box-shadow: none;
    /* CRITICAL: Use same transition as panel for perfect sync */
    transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmosphere-toggle-atmo.active {
    display: flex;
}

/* The visible part - only at top */
.atmosphere-toggle-atmo::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 36px;
    height: 110px;
    /* Glassmorphism style like atmosphere panel */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        -2px 0 12px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px 0 0 8px;
}

.atmosphere-toggle-atmo .atmo-text {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -45%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--accent);
    text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4);
    transition: all 0.3s ease;
    z-index: 1;
}

/* ===== CLOSED STATE ===== */
.atmosphere-toggle-atmo:not(.panel-open) {
    right: 0;
}

.atmosphere-toggle-atmo:not(.panel-open)::before {
    opacity: 1;
}

.atmosphere-toggle-atmo:not(.panel-open) .atmo-text {
    opacity: 1;
}

/* Hover when closed */
.atmosphere-toggle-atmo:not(.panel-open):hover::before {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(var(--accent-rgb, 124, 58, 237), 0.5),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-atmo:not(.panel-open):hover .atmo-text {
    color: white;
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

/* ===== OPEN STATE ===== */
.atmosphere-toggle-atmo.panel-open {
    right: 360px;
}

.atmosphere-toggle-atmo.panel-open::before {
    opacity: 1;
}

.atmosphere-toggle-atmo.panel-open .atmo-text {
    opacity: 1;
}

/* Hover when open */
.atmosphere-toggle-atmo.panel-open:hover::before {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(var(--accent-rgb, 124, 58, 237), 0.5),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-atmo.panel-open:hover .atmo-text {
    color: white;
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

/* Responsive adjustments for ATMO toggle - must match panel widths exactly */
@media (max-width: 1600px) {
    .atmosphere-toggle-atmo.panel-open {
        right: 320px;
    }
}

@media (max-width: 1400px) {
    .atmosphere-toggle-atmo.panel-open {
        right: 300px;
    }
}

@media (max-width: 1200px) {
    .atmosphere-toggle-atmo.panel-open {
        right: 280px;
    }
}

@media (max-width: 1024px) {
    .atmosphere-toggle-atmo.panel-open {
        right: 260px;
    }
}

/* Hide edge trigger when ATMO mode is active */
body.atmosphere-atmo-mode .media-edge-trigger {
    display: none !important;
}

/* Show ATMO button when ATMO mode is active */
body.atmosphere-atmo-mode .atmosphere-toggle-atmo {
    display: flex !important;
}

/* Hide ATMO button when NOT in ATMO mode */
body:not(.atmosphere-atmo-mode) .atmosphere-toggle-atmo {
    display: none !important;
}

/* ==========================================================================
   ATMOSPHERE TOGGLE TRIANGLE (Minimalist triangle button for right side)
   ========================================================================== */

.atmosphere-toggle-triangle {
    position: fixed;
    top: 0;
    z-index: 9998;
    width: 40px;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border: none;
    box-shadow: none;
    /* CRITICAL: Use same transition as panel for perfect sync */
    transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.atmosphere-toggle-triangle.active {
    display: flex;
}

/* The visible background part */
.atmosphere-toggle-triangle::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 40px;
    height: 120px;
    /* Glassmorphism style like atmosphere panel */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    /* Theme color border */
    border: 2px solid var(--accent);
    border-right: none;
    box-shadow: 
        -2px 0 12px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1),
        0 0 15px rgba(var(--accent-rgb), 0.3);
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-radius: 8px 0 0 8px;
}

.atmosphere-toggle-triangle .triangle-icon {
    position: relative;
    width: 28px;
    height: 28px;
    fill: var(--accent);
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.4));
    z-index: 1;
}

/* ===== CLOSED STATE ===== */
.atmosphere-toggle-triangle:not(.panel-open) {
    right: 0;
}

.atmosphere-toggle-triangle:not(.panel-open)::before {
    opacity: 1;
}

.atmosphere-toggle-triangle:not(.panel-open) .triangle-icon {
    opacity: 1;
    transform: scaleX(1);
}

/* Hover when closed */
.atmosphere-toggle-triangle:not(.panel-open):hover::before {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(var(--accent-rgb), 0.6),
        0 0 40px rgba(var(--accent-rgb), 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-triangle:not(.panel-open):hover .triangle-icon {
    fill: white;
    filter: drop-shadow(0 0 8px var(--accent));
    transform: scaleX(1) translateX(-2px);
}

/* ===== OPEN STATE ===== */
.atmosphere-toggle-triangle.panel-open {
    right: 360px;
}

.atmosphere-toggle-triangle.panel-open::before {
    opacity: 1;
}

.atmosphere-toggle-triangle.panel-open .triangle-icon {
    opacity: 1;
    transform: scaleX(-1);
}

/* Hover when open */
.atmosphere-toggle-triangle.panel-open:hover::before {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 
        -4px 0 20px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(var(--accent-rgb), 0.6),
        0 0 40px rgba(var(--accent-rgb), 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.15);
}

.atmosphere-toggle-triangle.panel-open:hover .triangle-icon {
    fill: white;
    filter: drop-shadow(0 0 8px var(--accent));
    transform: scaleX(-1) translateX(-2px);
}

/* Responsive adjustments for Triangle toggle - must match panel widths exactly */
@media (max-width: 1600px) {
    .atmosphere-toggle-triangle.panel-open {
        right: 320px;
    }
}

@media (max-width: 1400px) {
    .atmosphere-toggle-triangle.panel-open {
        right: 300px;
    }
}

@media (max-width: 1200px) {
    .atmosphere-toggle-triangle.panel-open {
        right: 280px;
    }
}

@media (max-width: 1024px) {
    .atmosphere-toggle-triangle.panel-open {
        right: 260px;
    }
}

/* Hide edge trigger when Triangle mode is active */
body.atmosphere-triangle-mode .media-edge-trigger {
    display: none !important;
}

/* Show Triangle button when Triangle mode is active */
body.atmosphere-triangle-mode .atmosphere-toggle-triangle {
    display: flex !important;
}

/* Hide Triangle button when NOT in Triangle mode */
body:not(.atmosphere-triangle-mode) .atmosphere-toggle-triangle {
    display: none !important;
}

/* Medium-large screens (1400px and below) */
@media (max-width: 1400px) {
    .media-quick-panel {
        width: 300px;
        right: -300px;
    }
    
    .media-quick-panel.open {
        right: 0;
    }
    
    .atmosphere-corner {
        width: 280px;
        right: -280px;
    }
    
    .atmosphere-corner.open {
        right: 0;
    }
    
    /* Smaller headers */
    .media-quick-header {
        padding: 18px 22px;
    }
    
    .media-quick-title {
        font-size: 18px;
    }
    
    .atmosphere-header {
        padding: 16px;
    }
    
    .atmosphere-title {
        font-size: 15px;
    }
    
    /* Smaller tabs */
    .media-quick-tab {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .media-quick-tab span:first-child {
        font-size: 18px;
    }
    
    .atmos-tab {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    /* Smaller content */
    .media-quick-content {
        padding: 14px;
    }
    
    .atmos-panel {
        padding: 12px;
    }
    
    .atmos-group {
        padding: 12px;
        gap: 12px;
    }
    
    /* Smaller grid items */
    .media-quick-grid {
        gap: 8px;
    }
    
    /* Smaller color pickers */
    .atmos-color-item input[type="color"] {
        width: 40px;
        height: 40px;
    }
    
    .atmos-color-grid-5 .atmos-color-item input[type="color"] {
        width: 34px;
        height: 34px;
    }
}

/* Medium screens (1200px and below) */
@media (max-width: 1200px) {
    .media-quick-panel {
        width: 280px;
        right: -280px;
    }
    
    .media-quick-panel.open {
        right: 0;
    }
    
    .atmosphere-corner {
        width: 260px;
        right: -260px;
    }
    
    .atmosphere-corner.open {
        right: 0;
    }
    
    /* More compact headers */
    .media-quick-header {
        padding: 14px 18px;
    }
    
    .media-quick-title {
        font-size: 16px;
    }
    
    .media-quick-close {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
    
    .atmosphere-header {
        padding: 14px;
    }
    
    .atmosphere-title {
        font-size: 14px;
    }
    
    .atmosphere-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    /* Compact tabs */
    .media-quick-tabs {
        padding: 12px;
        gap: 6px;
    }
    
    .media-quick-tab {
        padding: 6px 4px;
        font-size: 10px;
        gap: 2px;
    }
    
    .media-quick-tab span:first-child {
        font-size: 16px;
    }
    
    .atmos-tabs {
        padding: 10px;
        gap: 6px;
    }
    
    .atmos-tab {
        padding: 8px 6px;
        font-size: 10px;
        border-radius: 10px;
    }
    
    /* Compact content */
    .media-quick-content {
        padding: 12px;
    }
    
    .media-themes-container {
        padding: 14px;
        gap: 14px;
    }
    
    .atmos-panel {
        padding: 10px;
    }
    
    .atmos-group {
        padding: 10px;
        gap: 10px;
        border-radius: 10px;
    }
    
    .atmos-group-title {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    /* Smaller controls */
    .media-theme-select {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .atmos-select {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .atmos-row {
        font-size: 11px;
    }
    
    /* Smaller toggle button */
    .media-quick-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 16px;
        right: 16px;
    }
    
    /* 2-column grid instead of 3 for small panels */
    .media-quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    /* Smaller color pickers */
    .atmos-color-item input[type="color"] {
        width: 36px;
        height: 36px;
    }
    
    .atmos-color-grid-5 .atmos-color-item input[type="color"] {
        width: 30px;
        height: 30px;
    }
    
    .atmos-color-item label {
        font-size: 9px;
    }
}

/* Small-medium screens (1024px and below) */
@media (max-width: 1024px) {
    .media-quick-panel {
        width: 260px;
        right: -260px;
    }
    
    .media-quick-panel.open {
        right: 0;
    }
    
    .atmosphere-corner {
        width: 240px;
        right: -240px;
    }
    
    .atmosphere-corner.open {
        right: 0;
    }
    
    /* Very compact headers */
    .media-quick-header {
        padding: 12px 14px;
    }
    
    .media-quick-title {
        font-size: 14px;
    }
    
    .atmosphere-header {
        padding: 12px;
    }
    
    .atmosphere-title {
        font-size: 13px;
    }
    
    /* Very compact tabs */
    .media-quick-tabs {
        padding: 10px;
        gap: 4px;
    }
    
    .media-quick-tab {
        padding: 5px 3px;
        font-size: 9px;
        border-radius: 8px;
    }
    
    .media-quick-tab span:first-child {
        font-size: 14px;
    }
    
    .atmos-tabs {
        padding: 8px;
        gap: 4px;
    }
    
    .atmos-tab {
        padding: 6px 4px;
        font-size: 9px;
        border-radius: 8px;
    }
    
    /* Very compact content */
    .media-quick-content {
        padding: 10px;
    }
    
    .media-themes-container {
        padding: 12px;
        gap: 12px;
    }
    
    .media-theme-label {
        font-size: 11px;
    }
    
    .media-theme-value {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .atmos-panel {
        padding: 8px;
    }
    
    .atmos-group {
        padding: 8px;
        gap: 8px;
        border-radius: 8px;
    }
    
    .atmos-control label {
        font-size: 10px;
    }
    
    .atmos-btn {
        padding: 10px;
        font-size: 11px;
        border-radius: 8px;
    }
    
    /* Smaller toggle button */
    .media-quick-toggle {
        width: 44px;
        height: 44px;
        font-size: 18px;
        bottom: 12px;
        right: 12px;
        border-radius: 10px;
    }
    
    /* 4-column color grid becomes 3 */
    .atmos-color-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 5-column becomes 4 */
    .atmos-color-grid-5 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .atmos-color-item input[type="color"] {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .atmos-color-grid-5 .atmos-color-item input[type="color"] {
        width: 28px;
        height: 28px;
    }
    
    .atmos-color-item label {
        font-size: 8px;
    }
}

/* ==================== YOUTUBE BOTTOM CONTROLS ==================== */

.youtube-bottom-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== YOUTUBE CONTROL BUTTON ==================== */

.youtube-control-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e5e7eb);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.youtube-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.youtube-control-btn:active {
    transform: translateY(0);
}

/* ==================== YOUTUBE FITTING ROW ==================== */

.youtube-bottom-controls .youtube-fitting-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-sizing: border-box;
}

.youtube-bottom-controls .youtube-fitting-row label {
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.youtube-bottom-controls .youtube-fitting-select {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-primary, #e5e7eb);
    font-size: 12px;
    cursor: pointer;
    margin: 0;
}

/* ==================== YOUTUBE CONTROL WINDOW ==================== */

.youtube-control-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.youtube-control-overlay.active {
    opacity: 1;
    visibility: visible;
}

.youtube-control-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.youtube-control-window.active {
    opacity: 1;
    visibility: visible;
}

.youtube-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
    user-select: none;
}

.youtube-control-header:active {
    cursor: grabbing;
}

.youtube-control-title {
    color: var(--text-primary, #e5e7eb);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.youtube-control-title::before {
    content: '🎬';
}

.youtube-control-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary, #e5e7eb);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.youtube-control-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.youtube-control-content {
    flex: 1;
    background: #000;
    position: relative;
}

#youtubeControlPlayer {
    width: 100%;
    height: 100%;
}

#youtubeControlPlayer iframe,
#ytControlPlayer {
    width: 100%;
    height: 100%;
}
