/* Instagram Reels Cover Maker Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #ec4899;
}

.reels-editor-container {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 700px;
    background: var(--bg-dark);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    font-family: 'Inter', sans-serif;
}

/* Sidebar Tools */
.editor-sidebar {
    width: 320px;
    background: #1e293b;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 15px 5px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab-btn i {
    font-size: 18px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(236, 72, 153, 0.08);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls Styling */
.tool-section {
    margin-bottom: 25px;
}

.tool-label {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.color-swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #fff;
}

.btn-upload {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-upload:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--text-main);
}

.sidebar-buttons {
    box-shadow: none !important;
}

/* Canvas Area */
.editor-main {
    flex: 1;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
    overflow: hidden;
}

.canvas-wrapper {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 1px solid var(--border-color);
    background: #fff;
}

/* Controls Bar */
.canvas-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    border: 1px solid var(--border-color);
    z-index: 10;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* Property Panel inline in sidebar */
.properties-panel {
    padding: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    display: none;
}

.properties-panel.active {
    display: block;
}

/* Emojis grid */
.emojis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.emoji-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.emoji-item img.emoji {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.emoji-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 1200px) {
    .editor-sidebar {
        width: 80px;
    }

    .tab-btn span {
        display: none;
    }

    .sidebar-content {
        position: absolute;
        left: 80px;
        top: 0;
        bottom: 0;
        width: 240px;
        background: #1e293b;
        z-index: 100;
        box-shadow: 10px 0 15px rgba(0, 0, 0, 0.3);
        display: none;
    }

    .editor-sidebar:hover .sidebar-content {
        display: block;
    }
}

@media (max-width: 768px) {
    .reels-editor-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 120px);
    }

    .editor-main {
        order: 1;
        flex: none;
        height: 55vh;
        padding: 10px;
    }

    .editor-sidebar {
        order: 2;
        width: 100%;
        height: 45vh;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .sidebar-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sidebar-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        min-width: 70px;
        padding: 10px;
    }

    .tab-btn span {
        display: block;
        font-size: 11px;
    }

    .sidebar-content {
        position: relative;
        left: 0;
        width: 100%;
        height: calc(100% - 60px);
        display: block !important;
        box-shadow: none;
        background: transparent;
    }

    .canvas-controls {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        padding: 8px;
        border-radius: 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .control-btn {
        padding: 8px;
    }

    #export-btn {
        width: 100%;
        margin-top: 5px;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.active {
    display: flex;
}

.progress-container {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s;
}

.filter-btn {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    margin: 5px;
}

.filter-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.filter-btn:active {
    transform: scale(0.95);
}

.filter-btn.active {
    background: var(--accent-color);
    color: #fff;
}

/* Text Style Library */
.style-library {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.style-library::-webkit-scrollbar {
    width: 4px;
}

.style-library::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.text-style-btn {
    text-align: left;
    padding: 10px !important;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-style-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(3px);
    border-color: var(--accent-color);
}

.text-style-btn.active {
    background: var(--accent-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.text-style-btn i {
    width: 20px;
    font-size: 14px;
    opacity: 0.8;
}