/* ========================================
       Advanced YouTube Thumbnail Maker Styles
       Scoped to not affect header/footer
       ======================================== */
    
    :root {
        --ytm-primary: #851a20;
        --ytm-primary-dark: #6a1519;
        --ytm-primary-light: #a62029;
        --ytm-secondary: #ffcc48;
        --ytm-secondary-dark: #e6b73f;
        --ytm-tertiary: #fedccc;
        --ytm-dark: #1a1a2e;
        --ytm-darker: #0f0f1a;
        --ytm-gray: #6c757d;
        --ytm-gray-light: #e9ecef;
        --ytm-white: #ffffff;
        --ytm-success: #28a745;
        --ytm-danger: #dc3545;
        --ytm-warning: #ffc107;
        --ytm-info: #17a2b8;
        --ytm-shadow-sm: 0 2px 8px rgba(133, 26, 32, 0.1);
        --ytm-shadow: 0 4px 20px rgba(133, 26, 32, 0.15);
        --ytm-shadow-lg: 0 10px 40px rgba(133, 26, 32, 0.2);
        --ytm-radius-sm: 8px;
        --ytm-radius: 12px;
        --ytm-radius-lg: 20px;
        --ytm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Wrapper Styles (without variables) */
    .ytm-wrapper {
        font-family: 'Poppins', sans-serif;
        background-color: #f5f5f7;
        min-height: 100vh;
        color: var(--ytm-dark);
        position: relative;
        z-index: 1;
    }

    .ytm-wrapper * {
        /*color: black;*/
    }
    
    /* Modal button improvements */
    .ytm-modal .ytm-btn-primary,
    .ytm-modal .ytm-btn-secondary,
    .ytm-modal .ytm-btn-outline {
        min-width: 120px;
        padding: 12px 24px;
    }
    
    .ytm-modal-footer .ytm-btn-outline {
        background: var(--ytm-white);
    }
    
    .ytm-modal-footer .ytm-btn-outline:hover {
        background: var(--ytm-primary);
        color: var(--ytm-white);
    }
    
    .ytm-wrapper * {
        box-sizing: border-box;
    }
    
    /* Hero Section */
    .ytm-hero {
        background: var(--ytm-primary);
        padding: 50px 0 40px;
        position: relative;
        overflow: hidden;
    }
    
    .ytm-hero::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 500px;
        height: 500px;
        background: var(--ytm-secondary);
        border-radius: 50%;
        opacity: 0.1;
    }
    
    .ytm-hero::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -5%;
        width: 300px;
        height: 300px;
        background: var(--ytm-tertiary);
        border-radius: 50%;
        opacity: 0.1;
    }
    
    .ytm-hero-content {
        position: relative;
        z-index: 2;
        text-align: center;
    }
    
    .ytm-hero h1 {
        color: var(--ytm-white);
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 15px;
        line-height: 1.2;
    }
    
    .ytm-hero h1 span {
        color: var(--ytm-secondary);
    }
    
    .ytm-hero p {
        color: var(--ytm-tertiary);
        font-size: 1.1rem;
        max-width: 600px;
        margin: 0 auto 20px;
    }
    
    .ytm-rating-box {
        display: inline-flex;
        align-items: center;
        background: var(--ytm-white);
        padding: 10px 25px;
        border-radius: 50px;
        box-shadow: var(--ytm-shadow);
    }
    
    .ytm-rating-stars {
        color: var(--ytm-secondary);
        font-size: 1.1rem;
        margin-right: 10px;
    }
    
    .ytm-rating-text {
        color: var(--ytm-dark);
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    /* Trust Bar */
    .ytm-trust-bar {
        background: var(--ytm-white);
        padding: 20px 0;
        border-bottom: 1px solid var(--ytm-gray-light);
    }
    
    .ytm-trust-items {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 30px;
    }
    
    .ytm-trust-item {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--ytm-dark);
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    .ytm-trust-item i {
        color: var(--ytm-primary);
        font-size: 1.2rem;
    }
    
    /* Main Editor Section */
    .ytm-editor-section {
        padding: 30px 0 60px;
    }
    
    /* Ad Containers */
    .ytm-ad-container {
        position: sticky;
        top: 20px;
    }
    
    .ytm-ad-space {
        background: var(--ytm-white);
        border: 2px dashed #ddd;
        border-radius: var(--ytm-radius);
        min-height: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #999;
        font-size: 0.85rem;
    }
    
    .ytm-ad-space i {
        font-size: 2rem;
        margin-bottom: 10px;
        opacity: 0.5;
    }
    
    /* Editor Container */
    .ytm-editor-container {
        background: var(--ytm-white);
        border-radius: var(--ytm-radius-lg);
        box-shadow: var(--ytm-shadow-lg);
        overflow: hidden;
    }
    
    /* Top Toolbar */
    .ytm-top-toolbar {
        background: var(--ytm-dark);
        padding: 12px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ytm-toolbar-left,
    .ytm-toolbar-center,
    .ytm-toolbar-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .ytm-tool-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: var(--ytm-white);
        padding: 10px 16px;
        border-radius: var(--ytm-radius-sm);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }
    
    .ytm-tool-btn:hover {
        background: var(--ytm-primary);
    }
    
    .ytm-tool-btn.active {
        background: var(--ytm-primary);
    }
    
    .ytm-tool-btn-icon {
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    
    .ytm-tool-divider {
        width: 1px;
        height: 30px;
        background: rgba(255, 255, 255, 0.2);
        margin: 0 5px;
    }
    
    .ytm-zoom-controls {
        display: flex;
        align-items: center;
        gap: 5px;
        background: rgba(255, 255, 255, 0.1);
        padding: 5px 10px;
        border-radius: var(--ytm-radius-sm);
    }
    
    .ytm-zoom-btn {
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        color: var(--ytm-white);
        cursor: pointer;
        border-radius: 6px;
        transition: var(--ytm-transition);
    }
    
    .ytm-zoom-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .ytm-zoom-value {
        color: var(--ytm-white);
        font-size: 0.85rem;
        min-width: 50px;
        text-align: center;
    }
    
    /* Main Editor Area */
    .ytm-editor-main {
        display: flex;
        min-height: 600px;
    }
    
    /* Left Sidebar */
    .ytm-sidebar-left {
        width: 80px;
        background: var(--ytm-darker);
        padding: 15px 10px;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .ytm-sidebar-btn {
        width: 100%;
        aspect-ratio: 1;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        border-radius: var(--ytm-radius-sm);
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 0.65rem;
        padding: 10px 5px;
    }
    
    .ytm-sidebar-btn i {
        font-size: 1.2rem;
    }
    
    .ytm-sidebar-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--ytm-white);
    }
    
    .ytm-sidebar-btn.active {
        background: var(--ytm-primary);
        color: var(--ytm-white);
    }
    
    /* Canvas Area */
    .ytm-canvas-area {
        flex: 1;
        background: #2a2a3e;
        padding: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: auto;
    }
    
    .ytm-canvas-wrapper {
        position: relative;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
        border-radius: 4px;
        overflow: hidden;
    }
    
    .ytm-canvas-wrapper canvas {
        display: block;
    }
    
    /* Canvas Size Indicator */
    .ytm-canvas-size-indicator {
        position: absolute;
        bottom: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: var(--ytm-white);
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.75rem;
        z-index: 10;
    }
    
    /* Right Sidebar - Properties Panel */
    .ytm-sidebar-right {
        width: 320px;
        background: var(--ytm-white);
        border-left: 1px solid var(--ytm-gray-light);
        display: flex;
        flex-direction: column;
    }
    
    .ytm-panel-tabs {
        display: flex;
        background: var(--ytm-gray-light);
        padding: 5px;
        gap: 5px;
    }
    
    .ytm-panel-tab {
        flex: 1;
        padding: 10px;
        background: transparent;
        border: none;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--ytm-gray);
        cursor: pointer;
        border-radius: var(--ytm-radius-sm);
        transition: var(--ytm-transition);
    }
    
    .ytm-panel-tab:hover {
        color: var(--ytm-dark);
    }
    
    .ytm-panel-tab.active {
        background: var(--ytm-white);
        color: var(--ytm-primary);
        box-shadow: var(--ytm-shadow-sm);
    }
    
    .ytm-panel-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
    }
    
    .ytm-panel-section {
        margin-bottom: 25px;
    }
    
    .ytm-panel-title {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--ytm-dark);
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .ytm-panel-title i {
        color: var(--ytm-primary);
    }
    
    /* Form Controls */
    .ytm-input-group {
        margin-bottom: 15px;
    }
    
    .ytm-input-label {
        display: block;
        font-size: 0.8rem;
        color: var(--ytm-gray);
        margin-bottom: 6px;
    }
    
    .ytm-input {
        width: 100%;
        padding: 10px 14px;
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.9rem;
        transition: var(--ytm-transition);
        font-family: inherit;
    }
    
    .ytm-input:focus {
        outline: none;
        border-color: var(--ytm-primary);
        box-shadow: 0 0 0 3px rgba(133, 26, 32, 0.1);
    }
    
    .ytm-select {
        width: 100%;
        padding: 10px 14px;
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.9rem;
        background: var(--ytm-white);
        cursor: pointer;
        transition: var(--ytm-transition);
    }
    
    .ytm-select:focus {
        outline: none;
        border-color: var(--ytm-primary);
    }
    
    .ytm-textarea {
        width: 100%;
        padding: 12px 14px;
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.9rem;
        resize: vertical;
        min-height: 80px;
        font-family: inherit;
        transition: var(--ytm-transition);
    }
    
    .ytm-textarea:focus {
        outline: none;
        border-color: var(--ytm-primary);
        box-shadow: 0 0 0 3px rgba(133, 26, 32, 0.1);
    }
    
    /* Range Slider */
    .ytm-range-container {
        margin-bottom: 15px;
    }
    
    .ytm-range-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .ytm-range-label {
        font-size: 0.8rem;
        color: var(--ytm-gray);
    }
    
    .ytm-range-value {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--ytm-primary);
        background: var(--ytm-tertiary);
        padding: 2px 10px;
        border-radius: 20px;
    }
    
    .ytm-range {
        width: 100%;
        height: 6px;
        border-radius: 3px;
        background: var(--ytm-gray-light);
        outline: none;
        -webkit-appearance: none;
        cursor: pointer;
    }
    
    .ytm-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--ytm-primary);
        cursor: pointer;
        border: 3px solid var(--ytm-white);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: var(--ytm-transition);
    }
    
    .ytm-range::-webkit-slider-thumb:hover {
        transform: scale(1.1);
    }
    
    /* Color Picker */
    .ytm-color-picker {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .ytm-color-input {
        width: 50px;
        height: 40px;
        padding: 3px;
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        cursor: pointer;
        background: var(--ytm-white);
    }
    
    .ytm-color-input::-webkit-color-swatch-wrapper {
        padding: 0;
    }
    
    .ytm-color-input::-webkit-color-swatch {
        border: none;
        border-radius: 4px;
    }
    
    .ytm-color-hex {
        flex: 1;
        padding: 10px 14px;
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.85rem;
        font-family: monospace;
    }
    
    /* Color Presets */
    .ytm-color-presets {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    
    .ytm-color-preset {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        cursor: pointer;
        border: 3px solid transparent;
        transition: var(--ytm-transition);
        position: relative;
    }
    
    .ytm-color-preset:hover {
        transform: scale(1.15);
    }
    
    .ytm-color-preset.active {
        border-color: var(--ytm-dark);
    }
    
    /* Button Groups */
    .ytm-btn-group {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .ytm-btn-toggle {
        flex: 1;
        min-width: 40px;
        padding: 10px;
        background: var(--ytm-gray-light);
        border: none;
        color: var(--ytm-gray);
        cursor: pointer;
        transition: var(--ytm-transition);
        font-size: 0.9rem;
    }
    
    .ytm-btn-toggle:first-child {
        border-radius: var(--ytm-radius-sm) 0 0 var(--ytm-radius-sm);
    }
    
    .ytm-btn-toggle:last-child {
        border-radius: 0 var(--ytm-radius-sm) var(--ytm-radius-sm) 0;
    }
    
    .ytm-btn-toggle:only-child {
        border-radius: var(--ytm-radius-sm);
    }
    
    .ytm-btn-toggle:hover {
        background: var(--ytm-tertiary);
        color: var(--ytm-primary);
    }
    
    .ytm-btn-toggle.active {
        background: var(--ytm-primary);
        color: var(--ytm-white);
    }
    
    /* Primary Button */
    .ytm-btn-primary {
        width: 100%;
        padding: 14px 20px;
        background: var(--ytm-primary);
        color: var(--ytm-white);
        border: none;
        border-radius: var(--ytm-radius-sm);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .ytm-btn-primary:hover {
        background: var(--ytm-primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--ytm-shadow);
    }
    
    .ytm-btn-secondary {
        width: 100%;
        padding: 14px 20px;
        background: var(--ytm-secondary);
        color: var(--ytm-dark);
        border: none;
        border-radius: var(--ytm-radius-sm);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .ytm-btn-secondary:hover {
        background: var(--ytm-secondary-dark);
        transform: translateY(-2px);
        box-shadow: var(--ytm-shadow);
    }
    
    .ytm-btn-outline {
        width: 100%;
        padding: 12px 20px;
        background: transparent;
        color: var(--ytm-primary);
        border: 2px solid var(--ytm-primary);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .ytm-btn-outline:hover {
        background: var(--ytm-primary);
        color: var(--ytm-white);
    }
    
    /* Templates Grid */
    .ytm-templates-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .ytm-template-card {
        aspect-ratio: 16/9;
        border-radius: var(--ytm-radius-sm);
        overflow: hidden;
        cursor: pointer;
        position: relative;
        border: 3px solid transparent;
        transition: var(--ytm-transition);
    }
    
    .ytm-template-card:hover {
        border-color: var(--ytm-primary);
        transform: scale(1.02);
    }
    
    .ytm-template-card.active {
        border-color: var(--ytm-primary);
    }
    
    .ytm-template-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .ytm-template-preview {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: var(--ytm-white);
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        font-size: 0.9rem;
        text-align: center;
        padding: 10px;
    }
    
    /* Layers List */
    .ytm-layers-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .ytm-layer-item {
        display: flex;
        align-items: center;
        padding: 12px;
        background: var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        margin-bottom: 8px;
        cursor: pointer;
        transition: var(--ytm-transition);
        gap: 10px;
    }
    
    .ytm-layer-item:hover {
        background: var(--ytm-tertiary);
    }
    
    .ytm-layer-item.active {
        background: var(--ytm-tertiary);
        border-left: 4px solid var(--ytm-primary);
    }
    
    .ytm-layer-thumb {
        width: 40px;
        height: 40px;
        background: var(--ytm-white);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ytm-primary);
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .ytm-layer-info {
        flex: 1;
        min-width: 0;
    }
    
    .ytm-layer-name {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--ytm-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .ytm-layer-type {
        font-size: 0.7rem;
        color: var(--ytm-gray);
        text-transform: uppercase;
    }
    
    .ytm-layer-actions {
        display: flex;
        gap: 5px;
    }
    
    .ytm-layer-action {
        width: 28px;
        height: 28px;
        background: transparent;
        border: none;
        color: var(--ytm-gray);
        cursor: pointer;
        border-radius: 6px;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .ytm-layer-action:hover {
        background: var(--ytm-primary);
        color: var(--ytm-white);
    }
    
    /* Stickers Grid */
    .ytm-stickers-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        max-height: 200px;
        overflow-y: auto;
        padding: 5px;
    }
    
    .ytm-sticker-item {
        aspect-ratio: 1;
        background: var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
        transition: var(--ytm-transition);
        border: 2px solid transparent;
    }
    
    .ytm-sticker-item:hover {
        background: var(--ytm-tertiary);
        border-color: var(--ytm-primary);
        transform: scale(1.1);
    }
    
    /* Shapes Grid */
    .ytm-shapes-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .ytm-shape-item {
        aspect-ratio: 1;
        background: var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        color: var(--ytm-primary);
        cursor: pointer;
        transition: var(--ytm-transition);
        border: 2px solid transparent;
    }
    
    .ytm-shape-item:hover {
        background: var(--ytm-tertiary);
        border-color: var(--ytm-primary);
    }
    
    /* Bottom Action Bar */
    .ytm-action-bar {
        background: var(--ytm-gray-light);
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
        border-top: 1px solid #ddd;
    }
    
    .ytm-action-group {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .ytm-action-btn {
        padding: 10px 20px;
        background: var(--ytm-white);
        border: 2px solid var(--ytm-gray-light);
        border-radius: var(--ytm-radius-sm);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: var(--ytm-transition);
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--ytm-dark);
    }
    
    .ytm-action-btn:hover {
        border-color: var(--ytm-primary);
        color: var(--ytm-primary);
    }
    
    .ytm-action-btn-primary {
        background: var(--ytm-primary);
        color: var(--ytm-white);
        border-color: var(--ytm-primary);
    }
    
    .ytm-action-btn-primary:hover {
        background: var(--ytm-primary-dark);
        border-color: var(--ytm-primary-dark);
        color: var(--ytm-white);
    }
    
    .ytm-action-btn-success {
        background: var(--ytm-secondary);
        color: var(--ytm-dark);
        border-color: var(--ytm-secondary);
    }
    
    .ytm-action-btn-success:hover {
        background: var(--ytm-secondary-dark);
        border-color: var(--ytm-secondary-dark);
    }
    
    /* Modal Styles */
    /* Modal Styles - FIXED */
    .ytm-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.75);
        z-index: 999999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(5px);
    }
    
    .ytm-modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .ytm-modal {
        background: var(--ytm-white);
        border-radius: var(--ytm-radius-lg);
        max-width: 500px;
        width: 100%;
        max-height: 85vh;
        overflow: hidden;
        transform: scale(0.85) translateY(-30px);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
        position: relative;
    }
    
    .ytm-modal-overlay.active .ytm-modal {
        transform: scale(1) translateY(0);
    }
    
    .ytm-modal-header {
        padding: 20px 25px;
        border-bottom: 1px solid var(--ytm-gray-light);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--ytm-white);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .ytm-modal-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--ytm-dark);
        margin: 0;
    }
    
    .ytm-modal-close {
        width: 40px;
        height: 40px;
        background: var(--ytm-gray-light);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ytm-gray);
        transition: var(--ytm-transition);
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .ytm-modal-close:hover {
        background: var(--ytm-primary);
        color: var(--ytm-white);
        transform: rotate(90deg);
    }
    
    .ytm-modal-body {
        padding: 25px;
        overflow-y: auto;
        max-height: calc(85vh - 160px);
    }
    
    .ytm-modal-footer {
        padding: 20px 25px;
        border-top: 1px solid var(--ytm-gray-light);
        display: flex;
        gap: 12px;
        justify-content: flex-end;
        background: var(--ytm-gray-light);
        position: sticky;
        bottom: 0;
    }
    
    /* Alert Modal Specific */
    .ytm-alert-modal .ytm-modal {
        max-width: 420px;
        text-align: center;
    }
    
    .ytm-alert-modal .ytm-modal-body {
        padding: 40px 30px 30px;
    }
    
    .ytm-alert-icon {
        width: 90px;
        height: 90px;
        border-radius: 50%;
        margin: 0 auto 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.8rem;
        animation: ytmPulse 0.5s ease;
    }
    
    @keyframes ytmPulse {
        0% { transform: scale(0); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }
    
    .ytm-alert-icon.success {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        color: #28a745;
    }
    
    .ytm-alert-icon.error {
        background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
        color: #dc3545;
    }
    
    .ytm-alert-icon.warning {
        background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
        color: #e0a800;
    }
    
    .ytm-alert-icon.info {
        background: linear-gradient(135deg, #fedccc 0%, #fcd5c5 100%);
        color: #851a20;
    }
    
    .ytm-alert-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--ytm-dark);
        margin-bottom: 12px;
    }
    
    .ytm-alert-message {
        color: var(--ytm-gray);
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 30px;
    }
    
    /* Preview Modal Specific */
    .ytm-preview-modal .ytm-modal {
        max-width: 900px;
        width: 95%;
    }
    
    .ytm-preview-container {
        background: #0f0f0f;
        border-radius: var(--ytm-radius);
        padding: 25px;
    }
    
    .ytm-preview-image {
        width: 100%;
        border-radius: var(--ytm-radius-sm);
        margin-bottom: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .ytm-preview-meta {
        display: flex;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ytm-preview-avatar {
        width: 48px;
        height: 48px;
        background: #333;
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .ytm-preview-info {
        flex: 1;
    }
    
    .ytm-preview-info h4 {
        color: #fff;
        font-size: 1.1rem;
        margin: 0 0 8px 0;
        line-height: 1.4;
    }
    
    .ytm-preview-info p {
        color: #aaa;
        font-size: 0.85rem;
        margin: 0;
    }
    
    /* Download Modal */
    .ytm-download-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .ytm-download-option {
        padding: 20px;
        background: var(--ytm-gray-light);
        border-radius: var(--ytm-radius);
        text-align: center;
        cursor: pointer;
        border: 3px solid transparent;
        transition: var(--ytm-transition);
    }
    
    .ytm-download-option:hover {
        background: var(--ytm-tertiary);
    }
    
    .ytm-download-option.active {
        border-color: var(--ytm-primary);
        background: var(--ytm-tertiary);
    }
    
    .ytm-download-option i {
        font-size: 2rem;
        color: var(--ytm-primary);
        margin-bottom: 10px;
        display: block;
    }
    
    .ytm-download-option span {
        font-weight: 600;
        color: var(--ytm-dark);
    }
    
    /* Upload Area */
    .ytm-upload-area {
        border: 3px dashed var(--ytm-gray-light);
        border-radius: var(--ytm-radius);
        padding: 40px 20px;
        text-align: center;
        cursor: pointer;
        transition: var(--ytm-transition);
        background: var(--ytm-white);
    }
    
    .ytm-upload-area:hover,
    .ytm-upload-area.dragover {
        border-color: var(--ytm-primary);
        background: var(--ytm-tertiary);
    }
    
    .ytm-upload-area i {
        font-size: 3rem;
        color: var(--ytm-primary);
        margin-bottom: 15px;
    }
    
    .ytm-upload-area h4 {
        color: var(--ytm-dark);
        margin-bottom: 5px;
    }
    
    .ytm-upload-area p {
        color: var(--ytm-gray);
        font-size: 0.85rem;
        margin: 0;
    }
    
    /* Filters Section */
    .ytm-filters-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .ytm-filter-item {
        text-align: center;
        cursor: pointer;
        padding: 10px;
        border-radius: var(--ytm-radius-sm);
        border: 2px solid transparent;
        transition: var(--ytm-transition);
    }
    
    .ytm-filter-item:hover {
        background: var(--ytm-gray-light);
    }
    
    .ytm-filter-item.active {
        border-color: var(--ytm-primary);
        background: var(--ytm-tertiary);
    }
    
    .ytm-filter-preview {
        width: 100%;
        aspect-ratio: 16/9;
        background: var(--ytm-gray-light);
        border-radius: 6px;
        margin-bottom: 8px;
        overflow: hidden;
    }
    
    .ytm-filter-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .ytm-filter-name {
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--ytm-dark);
    }
    
    /* Info Sections */
    .ytm-info-section {
        padding: 60px 0;
    }
    
    .ytm-info-section.bg-white {
        background: var(--ytm-white);
    }
    
    .ytm-info-section.bg-light {
        background: var(--ytm-gray-light);
    }
    
    .ytm-info-section.bg-primary {
        background: var(--ytm-primary);
    }
    
    .ytm-section-header {
        text-align: center;
        margin-bottom: 50px;
    }
    
    .ytm-section-header h2 {
        font-size: 2rem;
        font-weight: 700;
        color: var(--ytm-dark);
        margin-bottom: 15px;
    }
    
    .ytm-section-header p {
        color: var(--ytm-gray);
        font-size: 1.1rem;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .ytm-info-section.bg-primary .ytm-section-header h2 {
        color: var(--ytm-white);
    }
    
    .ytm-info-section.bg-primary .ytm-section-header p {
        color: var(--ytm-tertiary);
    }
    
    /* Feature Cards */
    .ytm-feature-card {
        background: var(--ytm-white);
        border-radius: var(--ytm-radius);
        padding: 30px;
        text-align: center;
        height: 100%;
        transition: var(--ytm-transition);
        border: 2px solid transparent;
    }
    
    .ytm-feature-card:hover {
        border-color: var(--ytm-primary);
        transform: translateY(-5px);
        box-shadow: var(--ytm-shadow);
    }
    
    .ytm-feature-icon {
        width: 70px;
        height: 70px;
        background: var(--ytm-tertiary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 20px;
        font-size: 1.8rem;
        color: var(--ytm-primary);
    }
    
    .ytm-feature-card h3 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--ytm-dark);
        margin-bottom: 10px;
    }
    
    .ytm-feature-card p {
        color: var(--ytm-gray);
        font-size: 0.9rem;
        line-height: 1.6;
        margin: 0;
    }
    
    /* Steps */
    .ytm-steps {
        display: flex;
        justify-content: space-between;
        position: relative;
    }
    
    .ytm-steps::before {
        content: '';
        position: absolute;
        top: 35px;
        left: 10%;
        right: 10%;
        height: 3px;
        background: var(--ytm-gray-light);
        z-index: 0;
    }
    
    .ytm-step {
        text-align: center;
        position: relative;
        z-index: 1;
        flex: 1;
        padding: 0 15px;
    }
    
    .ytm-step-number {
        width: 70px;
        height: 70px;
        background: var(--ytm-primary);
        color: var(--ytm-white);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 auto 20px;
        border: 5px solid var(--ytm-white);
        box-shadow: var(--ytm-shadow);
    }
    
    .ytm-step h4 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--ytm-dark);
        margin-bottom: 10px;
    }
    
    .ytm-step p {
        color: var(--ytm-gray);
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* FAQ */
    .ytm-faq-item {
        background: var(--ytm-white);
        border-radius: var(--ytm-radius);
        margin-bottom: 15px;
        overflow: hidden;
        border: 2px solid var(--ytm-gray-light);
        transition: var(--ytm-transition);
    }
    
    .ytm-faq-item:hover {
        border-color: var(--ytm-secondary);
    }
    
    .ytm-faq-item.active {
        border-color: var(--ytm-primary);
    }
    
    .ytm-faq-question {
        width: 100%;
        padding: 20px 25px;
        background: transparent;
        border: none;
        text-align: left;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1rem;
        font-weight: 600;
        color: var(--ytm-dark);
    }
    
    .ytm-faq-question i {
        color: var(--ytm-primary);
        transition: var(--ytm-transition);
    }
    
    .ytm-faq-item.active .ytm-faq-question i {
        transform: rotate(180deg);
    }
    
    .ytm-faq-answer {
        display: none;
        padding: 0 25px 20px;
        color: var(--ytm-gray);
        line-height: 1.7;
    }
    
    .ytm-faq-item.active .ytm-faq-answer {
        display: block;
    }
    
    /* CTA Section */
    .ytm-cta-content {
        text-align: center;
    }
    
    .ytm-cta-content h2 {
        color: var(--ytm-white);
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .ytm-cta-content p {
        color: var(--ytm-tertiary);
        font-size: 1.1rem;
        margin-bottom: 25px;
    }
    
    .ytm-cta-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: var(--ytm-secondary);
        color: var(--ytm-dark);
        padding: 15px 40px;
        border-radius: 50px;
        font-size: 1.1rem;
        font-weight: 600;
        text-decoration: none;
        transition: var(--ytm-transition);
    }
    
    .ytm-cta-btn:hover {
        background: var(--ytm-white);
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        color: var(--ytm-dark);
    }
    
    /* Keyboard Shortcuts */
    .ytm-shortcuts-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .ytm-shortcut {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        background: var(--ytm-gray-light);
        border-radius: 6px;
    }
    
    .ytm-shortcut kbd {
        background: var(--ytm-white);
        padding: 4px 10px;
        border-radius: 4px;
        font-family: monospace;
        font-size: 0.8rem;
        border: 1px solid #ddd;
        box-shadow: 0 2px 0 #ddd;
    }
    
    .ytm-shortcut span {
        font-size: 0.8rem;
        color: var(--ytm-gray);
    }
    
    /* Responsive */
    @media (max-width: 1400px) {
        .ytm-ad-container {
            display: none;
        }
    }
    
    @media (max-width: 1200px) {
        .ytm-sidebar-right {
            width: 280px;
        }
    }
    
    @media (max-width: 992px) {
        .ytm-editor-main {
            flex-direction: column;
        }
        
        .ytm-sidebar-left {
            width: 100%;
            flex-direction: row;
            overflow-x: auto;
            padding: 10px;
        }
        
        .ytm-sidebar-btn {
            width: auto;
            aspect-ratio: auto;
            padding: 10px 15px;
            flex-direction: row;
        }
        
        .ytm-sidebar-right {
            width: 100%;
        }
        
        .ytm-canvas-area {
            min-height: 400px;
        }
        
        .ytm-steps {
            flex-direction: column;
            gap: 30px;
        }
        
        .ytm-steps::before {
            display: none;
        }
    }
    
    @media (max-width: 768px) {
        .ytm-hero h1 {
            font-size: 1.8rem;
        }
        
        .ytm-top-toolbar {
            flex-direction: column;
            gap: 10px;
        }
        
        .ytm-toolbar-left,
        .ytm-toolbar-center,
        .ytm-toolbar-right {
            width: 100%;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .ytm-action-bar {
            flex-direction: column;
        }
        
        .ytm-action-group {
            width: 100%;
            justify-content: center;
        }
        
        .ytm-section-header h2 {
            font-size: 1.5rem;
        }
        
        .ytm-templates-grid {
            grid-template-columns: 1fr;
        }
        
        .ytm-download-options {
            grid-template-columns: 1fr;
        }
    }
    
    /* No Selection State */
    .ytm-no-selection {
        text-align: center;
        padding: 40px 20px;
        color: var(--ytm-gray);
    }
    
    .ytm-no-selection i {
        font-size: 3rem;
        margin-bottom: 15px;
        opacity: 0.5;
    }
    
    .ytm-no-selection h4 {
        font-size: 1rem;
        margin-bottom: 5px;
        color: var(--ytm-dark);
    }
    
    .ytm-no-selection p {
        font-size: 0.85rem;
    }
    
    /* Loading Overlay */
    .ytm-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.95);
        z-index: 9999999;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .ytm-loading-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .ytm-spinner {
        width: 60px;
        height: 60px;
        border: 5px solid var(--ytm-gray-light);
        border-top-color: var(--ytm-primary);
        border-radius: 50%;
        animation: ytmSpin 0.8s linear infinite;
        margin-bottom: 20px;
    }
    
    @keyframes ytmSpin {
        to { transform: rotate(360deg); }
    }
    
    .ytm-loading-text {
        color: var(--ytm-dark);
        font-weight: 600;
        font-size: 1rem;
    }
    
    /* Hidden Panels */
    .ytm-panel-hidden {
        display: none !important;
    }
    
    /* Custom Scrollbar */
    .ytm-wrapper ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .ytm-wrapper ::-webkit-scrollbar-track {
        background: var(--ytm-gray-light);
        border-radius: 4px;
    }
    
    .ytm-wrapper ::-webkit-scrollbar-thumb {
        background: var(--ytm-gray);
        border-radius: 4px;
    }
    
    .ytm-wrapper    ::-webkit-scrollbar-thumb:hover {
        background: var(--ytm-primary);
    }
    
    /* Transform Controls on Canvas */
    .ytm-transform-controls {
        position: absolute;
        pointer-events: none;
        z-index: 1000;
    }
    
    .ytm-transform-controls.active {
        pointer-events: auto;
    }
    
    .ytm-transform-box {
        position: absolute;
        border: 2px solid var(--ytm-primary);
        pointer-events: none;
    }
    
    .ytm-resize-handle {
        position: absolute;
        width: 12px;
        height: 12px;
        background: var(--ytm-white);
        border: 2px solid var(--ytm-primary);
        border-radius: 50%;
        pointer-events: auto;
        cursor: pointer;
        transform: translate(-50%, -50%);
    }
    
    .ytm-resize-handle.nw { top: 0; left: 0; cursor: nw-resize; }
    .ytm-resize-handle.n { top: 0; left: 50%; cursor: n-resize; }
    .ytm-resize-handle.ne { top: 0; left: 100%; cursor: ne-resize; }
    .ytm-resize-handle.e { top: 50%; left: 100%; cursor: e-resize; }
    .ytm-resize-handle.se { top: 100%; left: 100%; cursor: se-resize; }
    .ytm-resize-handle.s { top: 100%; left: 50%; cursor: s-resize; }
    .ytm-resize-handle.sw { top: 100%; left: 0; cursor: sw-resize; }
    .ytm-resize-handle.w { top: 50%; left: 0; cursor: w-resize; }
    
    .ytm-rotate-handle {
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 24px;
        background: var(--ytm-primary);
        border-radius: 50%;
        pointer-events: auto;
        cursor: grab;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ytm-white);
        font-size: 0.7rem;
    }
    
    .ytm-rotate-line {
        position: absolute;
        top: -28px;
        left: 50%;
        width: 2px;
        height: 28px;
        background: var(--ytm-primary);
        transform: translateX(-50%);
    }
    
    /* Context Menu */
    .ytm-context-menu {
        position: fixed;
        background: var(--ytm-white);
        border-radius: var(--ytm-radius-sm);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        padding: 10px 0;
        min-width: 200px;
        z-index: 9999999;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.9);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    }
    
    .ytm-context-menu.active {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
    
    .ytm-context-item {
        padding: 12px 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        font-size: 0.9rem;
        color: var(--ytm-dark);
        transition: var(--ytm-transition);
    }
    
    .ytm-context-item:hover {
        background: var(--ytm-tertiary);
        color: var(--ytm-primary);
    }
    
    .ytm-context-item i {
        width: 18px;
        text-align: center;
        color: var(--ytm-gray);
        font-size: 0.9rem;
    }
    
    .ytm-context-item:hover i {
        color: var(--ytm-primary);
    }
    
    .ytm-context-divider {
        height: 1px;
        background: var(--ytm-gray-light);
        margin: 8px 0;
    }
    
    .ytm-context-item.danger {
        color: var(--ytm-danger);
    }
    
    .ytm-context-item.danger:hover {
        background: #fff5f5;
    }
    
    .ytm-context-item.danger i {
        color: var(--ytm-danger);
    }
        
    /* Tooltip */
    .ytm-tooltip {
        position: relative;
    }
    
    .ytm-tooltip::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--ytm-dark);
        color: var(--ytm-white);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: var(--ytm-transition);
        pointer-events: none;
        margin-bottom: 8px;
    }
    
    .ytm-tooltip:hover::after {
        opacity: 1;
        visibility: visible;
    }
    
    
    
    
    /* Confirm Modal Specific */
    #confirmModal .ytm-modal-body {
        padding: 30px 25px;
    }
    
    #confirmModal .ytm-modal-body p {
        font-size: 1rem;
        color: var(--ytm-gray);
        line-height: 1.7;
        margin: 0;
    }
    
    /* Shape/Sticker/Text Modals */
    #addTextModal .ytm-modal,
    #addShapeModal .ytm-modal,
    #addStickerModal .ytm-modal,
    #filtersModal .ytm-modal {
        max-width: 520px;
    }
        
    /* Gradient Backgrounds for Templates */
    .ytm-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
    .ytm-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
    .ytm-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
    .ytm-gradient-4 { background: linear-gradient(135deg, #851a20 0%, #ffcc48 100%); }
    .ytm-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
    .ytm-gradient-6 { background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%); }
    .ytm-gradient-7 { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
    .ytm-gradient-8 { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }
    .ytm-gradient-9 { background: linear-gradient(135deg, #7f00ff 0%, #e100ff 100%); }
    
    /* Image effects classes */
    .filter-none { filter: none; }
    .filter-grayscale { filter: grayscale(100%); }
    .filter-sepia { filter: sepia(100%); }
    .filter-blur { filter: blur(2px); }
    .filter-brightness { filter: brightness(1.3); }
    .filter-contrast { filter: contrast(1.5); }
    .filter-saturate { filter: saturate(2); }
    .filter-hue-rotate { filter: hue-rotate(90deg); }
    .filter-invert { filter: invert(100%); }
    .filter-vintage { filter: sepia(50%) contrast(1.2) brightness(0.9); }
    .filter-cool { filter: saturate(1.5) hue-rotate(180deg); }
    .filter-warm { filter: saturate(1.5) sepia(30%); }
    
    
    
    /* Force modal to be on top of everything */
    body.modal-open {
        overflow: hidden !important;
    }
    
    .ytm-modal-overlay {
        isolation: isolate;
    }
    
    /* Ensure wrapper doesn't create stacking context issues */
    .ytm-wrapper * {
        /* Don't let any element create a new stacking context that could interfere with modals */
    }
    
    /* Fix for any potential parent z-index issues */
    .ytm-modal-overlay,
    .ytm-loading-overlay,
    .ytm-context-menu {
        position: fixed !important;
    }