/* CSS Variables - Imported from shared file */
@import url('css-variables.css');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", "Arial", sans-serif;
}

/* Channel Name Link Styles */
.channel-name-link {
    color: var(--header-channel-name-color, #111827);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.channel-name-link:hover {
    color: var(--header-channel-name-hover-color, #374151);
    transform: translateY(-1px);
}

.channel-name-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--header-channel-name-hover-color, #374151);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

.channel-name-link:hover::after {
    width: 100%;
}

.channel-name-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    border-radius: 4px;
}

/* Add subtle glow effect on hover */
.channel-name-link:hover {
    text-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

body {
    font-family: "Roboto", "Arial", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #374151;
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    padding: 0 1rem;
    height: 100%;
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding-top: 80px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 50px;
    height: 50px;
    display: block;
}

.title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.title p {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #3b82f6;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.nav-link i {
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    margin-top: 80px;
    height: calc(100vh - 80px - 2rem);
    display: none; /* Hidden by default, shown after auth check */
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    margin: 1rem;
}

/* Window Container */
.window-container {
    background: #f3f4f6;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Fullscreen mode for main-content */
.main-content.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    margin: 0 !important;
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100vw !important;
    background: #f3f4f6 !important;
}

.window-container.fullscreen {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: 0;
}

.main-content.fullscreen .config-sidebar {
    top: 0 !important;
    height: 100vh !important;
}

.main-content.fullscreen .window-content {
    height: calc(100vh - 80px) !important;
}

/* Ensure fullscreen content covers everything including header */
.main-content.fullscreen {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.main-content.fullscreen .preview-container {
    height: 100% !important;
}

.main-content.fullscreen .widget-preview {
    height: 100% !important;
    max-height: none !important;
}

.main-content.fullscreen .config-content {
    max-height: none !important;
    height: 100% !important;
}

/* Window Header */
.window-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.window-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Preview Mode Switcher */
.preview-mode-switcher {
    display: flex;
    align-items: center;
    background: #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-right: 0.75rem;
}

.preview-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-mode-btn:hover {
    color: #111827;
}

.preview-mode-btn.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-mode-btn svg {
    width: 1rem;
    height: 1rem;
}

/* New Widget Button */
.new-widget-btn {
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.75rem;
}

.new-widget-btn:hover {
    background: #059669;
}

.new-widget-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Config Toggle Button */
.config-toggle-btn {
    background: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 0.5rem;
}

.config-toggle-btn:hover {
    background: #4b5563;
}

.config-toggle-btn.active {
    background: #3b82f6;
}

.config-toggle-btn.active:hover {
    background: #2563eb;
}

.config-toggle-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Save Button */
.save-btn {
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-btn:hover {
    background: #1d4ed8;
}

.save-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Fullscreen Button */
.fullscreen-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.fullscreen-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.fullscreen-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Window Content */
.window-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Configuration Sidebar */
.config-sidebar {
    width: 30%;
    background: #111827;
    color: white;
    overflow-y: auto;
    display: flex;
    height: 100%;
    position: fixed;
    top: 74px;
    left: 0;
    bottom: 0;
    z-index: 20;
}

/* Navigation Sidebar */
.config-nav {
    width: 64px;
    background: #1f2937;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 25;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #374151;
    color: white;
}

.nav-btn.active {
    background: #374151;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 0 0 rgba(59, 130, 246, 0.5);
    position: relative;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.5rem;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    pointer-events: none;
}

.nav-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.nav-btn:hover svg {
    transform: scale(1.1);
}

.nav-btn.active svg {
    transform: scale(1.05);
}

/* Content Area */
.config-content {
    position: relative;
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    /* Ensure scrollbar appears when content overflows */
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
    /* Ensure popup positioning works correctly */
    position: relative;
}

/* Webkit scrollbar styling */
.config-content::-webkit-scrollbar {
    width: 8px;
}

.config-content::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

.config-content::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.config-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.content-header {
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.content-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.config-section {
    display: none;
}

.config-section.active {
    display: block;
}

/* Space utilities */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Source Section specific styles */
#source-section .space-y-6 > * + * {
    margin-top: 1.5rem;
}

#source-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

#source-section input:not(.slider-checkbox) {
    padding: 0.5rem 0.75rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
}

#source-section input::placeholder {
    color: #9ca3af;
}

#source-section input:not(.slider-checkbox):focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Advanced Section specific styles */
#advanced-section input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
}

#advanced-section input::placeholder {
    color: #9ca3af;
}

#advanced-section input:focus {
    outline: none;
    border-color: #4b5563;
}

#advanced-section button {
    border: none;
}

#source-section p {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Grid utilities */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    background: #374151;
    color: white;
    font-size: 0.875rem;
}

/* Enhanced Color Picker Styles */
.form-group input[type="color"],
input[type="color"] {
    width: 100%;
    height: 3rem;
    padding: 0.25rem;
    border: 2px solid #4b5563;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.form-group input[type="color"]:hover,
input[type="color"]:hover {
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-group input[type="color"]:focus,
input[type="color"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(96, 165, 250, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.form-group input[type="color"]:active,
input[type="color"]:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Color Picker Webkit Styles */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Firefox Color Picker Styles */
input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Color Picker Container Enhancement */
.color-picker-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker-container input[type="color"] {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
}

.color-picker-container .color-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.color-picker-container .color-hex {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e7eb;
    background: #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    text-align: center;
    letter-spacing: 0.05em;
}

/* Hexagonal Color Picker - Clean & Minimalist */
.hexagonal-color-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #4b5563;
    transition: all 0.2s ease;
}

.hexagonal-color-picker:last-child {
    border-bottom: none;
}

.hexagonal-color-picker .color-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.hexagonal-color-picker .hex-color-indicator {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-value, #ffffff) !important;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.hexagonal-color-picker .hex-color-indicator:hover {
    transform: scale(1.1);
    border-color: #60a5fa;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
}

.hexagonal-color-picker .hex-color-indicator:active {
    transform: scale(0.95);
}

.hexagonal-color-picker .hex-color-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hexagonal-color-picker .hex-color-indicator:hover::before {
    opacity: 1;
}



/* Hexagonal Color Picker Container */
.hex-color-picker-container {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 0.5rem;
    max-width: 400px;
}

.hex-color-picker-container .container-title {
    color: #e5e7eb;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #374151;
}

/* Hexagonal Color Picker Variations */
.hex-color-picker-small .hex-color-indicator {
    width: 1.5rem;
    height: 1.5rem;
}

.hex-color-picker-large .hex-color-indicator {
    width: 2.5rem;
    height: 2.5rem;
}

.hex-color-picker-compact {
    padding: 0.5rem 0;
}

.hex-color-picker-compact .color-label {
    font-size: 0.8rem;
}

/* Hexagonal Color Picker with Input */
.hex-color-picker-with-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hex-color-picker-with-input .hex-color-indicator {
    flex-shrink: 0;
}

.hex-color-picker-with-input .color-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hex-color-picker-with-input .color-input-group input[type="color"] {
    width: 100%;
    height: 2rem;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hex-color-picker-with-input .color-input-group input[type="color"]:hover {
    border-color: #60a5fa;
}

.hex-color-picker-with-input .color-input-group input[type="color"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.hex-color-picker-with-input .color-hex-value {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #9ca3af;
    background: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #4b5563;
    text-align: center;
    user-select: all;
    cursor: text;
}

/* Enhanced Color Picker with Preview */
.enhanced-color-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.enhanced-color-picker:hover {
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.enhanced-color-picker .color-preview {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    border: 2px solid #4b5563;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enhanced-color-picker .color-preview:hover {
    transform: scale(1.05);
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.enhanced-color-picker .color-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.enhanced-color-picker .color-preview:hover::before {
    opacity: 1;
}

.enhanced-color-picker .color-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.enhanced-color-picker .color-input label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.enhanced-color-picker .color-input input[type="color"] {
    width: 100%;
    height: 2.5rem;
    border: 2px solid #4b5563;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enhanced-color-picker .color-input input[type="color"]:hover {
    border-color: #60a5fa;
    transform: translateY(-1px);
}

.enhanced-color-picker .color-input input[type="color"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.enhanced-color-picker .color-hex-display {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9ca3af;
    background: #1f2937;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    text-align: center;
    letter-spacing: 0.05em;
    user-select: all;
    cursor: text;
}

.enhanced-color-picker .color-hex-display:focus {
    outline: none;
    border-color: #60a5fa;
    background: #374151;
    color: #e5e7eb;
}

/* Color Picker Animation and Effects */
@keyframes colorPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(96, 165, 250, 0);
    }
}

.color-picker-active {
    animation: colorPulse 2s infinite;
}

/* Modern Color Swatch Grid */
.color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 2px solid #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #60a5fa;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
}

.color-swatch.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.color-swatch::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-swatch.selected::before {
    opacity: 1;
}

/* Color Picker Tooltip */
.color-picker-tooltip {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    border: 1px solid #4b5563;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-picker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 0.25rem solid transparent;
    border-top-color: #1f2937;
}

.color-picker-tooltip.show {
    opacity: 1;
}

/* Inline Color Picker Panel */
.inline-color-picker {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 400px;
    max-height: 600px;
    overflow: hidden;
    color: #374151;
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #1f2937;
    border-bottom: 1px solid #374151;
    border-radius: 0.75rem 0.75rem 0 0;
}

.picker-header span {
    font-weight: 600;
    font-size: 1rem;
    color: #9ca3af;
}

.picker-close {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-close:hover {
    background: #059669;
}

.picker-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.hex-color-popup-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #374151;
    z-index: 10000;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Ensure dropdown is responsive on mobile */
@media (max-width: 480px) {
    .hex-color-dropdown {
        width: calc(100vw - 40px);
        max-height: calc(100vh - 80px);
    }
    
    .hex-color-grid {
        width: 240px;
        height: 240px;
    }
}

/* Ensure popup renders above other content */
.hex-color-popup {
    z-index: 1000;
}

/* Color Controls Styling */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.opacity-slider-container {
    position: relative;
    height: 24px;
    width: 200px;
    border-radius: 4px;
    overflow: hidden;
}

.opacity-control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.opacity-value {
    font-size: 0.875rem;
    color: #9ca3af;
    min-width: 3rem;
    text-align: right;
}

/* Picker Footer */
.picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-top: 1px solid #374151;
}

.footer-left {
    display: flex;
    align-items: center;
}

.custom-color-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-color-btn:hover {
    background: #4b5563;
    border-color: #60a5fa;
}

.custom-color-btn svg {
    width: 1rem;
    height: 1rem;
}

.custom-color-picker-container {
    padding: 0.5rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-color-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

/* Main Color Selection Area */
.color-selection-area {
    width: 200px;
    height: 200px;
    position: relative;
    cursor: crosshair;
    border: 1px solid #4b5563;
    margin: 0 auto;
}

.color-selection-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 1px #000;
}

/* Controls Row */
.custom-controls-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hue-slider-container {
    width: 100%;
}

.hue-slider {
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00, #00ff80, #00ffff, #0080ff, #0000ff, #8000ff, #ff00ff, #ff0080, #ff0000);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #374151;
    border-radius: 50%;
    cursor: pointer;
}

.custom-opacity-container {
    width: 100%;
}

.custom-opacity-container .opacity-control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-opacity-container .opacity-value {
    font-size: 0.875rem;
    color: #9ca3af;
    min-width: 3rem;
    text-align: right;
}

.custom-opacity-container .opacity-slider {
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.custom-opacity-container .opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #374151;
    border-radius: 4px;
    cursor: pointer;
}

.custom-opacity-container .opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #374151;
    border-radius: 4px;
    cursor: pointer;
}

/* Color Value Inputs */
.color-value-inputs {
    display: flex;
    gap: 0.2rem;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 50px;
    flex: 1;
}

/* Make hex input longer than RGBA inputs */
.input-group:first-child {
    flex: 1.5;
}

.input-group:first-child .color-input {
    width: 100%;
}

.input-group label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.color-input {
    padding: 0.2rem 0.2rem;
    border: 1px solid #6b7280;
    background: #374151;
    color: #f9fafb;
    font-size: 0.875rem;
    font-family: monospace;
    text-align: center;
    width: 100%;
}

.color-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Remove spinner arrows from number inputs */
.color-input::-webkit-outer-spin-button,
.color-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.color-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Action Buttons */
.custom-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.custom-cancel-btn {
    background: #374151;
    color: #f9fafb;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-cancel-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.custom-apply-btn {
    background: #10b981;
    color: #f9fafb;
    border: 1px solid #059669;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-apply-btn:hover {
    background: #059669;
    border-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.footer-right {
    display: flex;
    align-items: center;
}

.color-preview-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-preview-label {
    font-size: 0.875rem;
    color: #9ca3af;
}

.color-preview-wrapper {
    position: relative;
    width: 2rem;
    height: 2rem;
}

.color-preview-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 8px 8px;
    z-index: 1;
    overflow: hidden;
}

.color-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #ef4444;
    z-index: 2;
    overflow: hidden;
}

.opacity-slider-container {
    background: 
        linear-gradient(to right, rgba(239, 68, 68, 0.1), #ef4444), 
        repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}



.opacity-slider {
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #374151;
    border-radius: 4px;
    cursor: pointer;
}

.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #374151;
    border-radius: 4px;
    cursor: pointer;
}

.header-left {
    display: flex;
    align-items: center;
}

.hex-color-popup-title {
    color: #f9fafb;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.dropdown-close {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-color-popup-close:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

.color-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
}

.color-input {
    border: 2px solid #6b7280;
    font-size: 0.875rem;
    color: #ffffff;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.color-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.body-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Ensure content doesn't interfere with scrolling */
    min-height: 0;
    flex: 1;
}

.transparency-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.gradient-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.5rem;
}

.gradient-slider-track {
    position: relative;
    flex: 1;
    height: 24px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #4b5563;
}

.gradient-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #f9fafb, #fca5a5, #f87171, #ef4444, #dc2626);
    border-radius: 4px;
    z-index: 1;
}

.gradient-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    z-index: 2;
}

.gradient-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 24px;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gradient-slider::-moz-range-thumb {
    width: 16px;
    height: 24px;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.transparency-value {
    color: #f9fafb;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 3rem;
    text-align: center;
}

.dropdown-footer {
    padding: 1rem;
    border-top: 1px solid #374151;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0 0 0.75rem 0.75rem;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hex-color-custom {
    display: flex;
    align-items: center;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.hex-color-custom:hover {
    background: #4b5563;
    border-color: #60a5fa;
    color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.custom-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.color-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.selected-color-preview {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    border: 2px solid #4b5563;
    background: #6b7280;
    transition: all 0.2s ease;
}

.hex-color-grid {
    position: relative;
    width: 280px;  /* Reduced from 320px */
    height: 280px; /* Reduced from 320px */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 auto;
}

.hex-color-swatch {
    position: absolute;
    width: 22px;
    height: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 22px;
    line-height: 22px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Ensure proper positioning relative to grid center */
    transform: translate(-50%, -50%);
}



.hex-color-swatch:hover {
    font-size: 28px;
    width: 28px;
    height: 28px;
    line-height: 28px;
}

.hex-color-swatch.selected {
    -webkit-text-stroke: 1.15px rgb(0, 0, 0) !important;
    filter: drop-shadow(0 0 1px #ffffff) drop-shadow(0 0 1px #ffffff) !important;
    z-index: 20 !important;
    font-size: 32px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
}



/* Responsive Color Picker Design */
@media (max-width: 768px) {
    .enhanced-color-picker {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .enhanced-color-picker .color-preview {
        width: 4rem;
        height: 4rem;
        align-self: center;
    }
    
    .enhanced-color-picker .color-input input[type="color"] {
        height: 3rem;
    }
    
    .color-swatch-grid {
        grid-template-columns: repeat(auto-fit, minmax(2.5rem, 1fr));
        gap: 0.75rem;
    }
    
    .color-swatch {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* Hexagonal Color Picker Mobile */
    .hex-color-picker-container {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .hexagonal-color-picker {
        padding: 1rem 0;
    }
    

    
    /* Hexagonal Color Modal Mobile */
    .hex-color-modal-content {
        max-width: 95%;
        padding: 1rem;
    }
    
    .hex-color-grid {
        width: 300px;
        height: 300px;
    }
    
    .hex-color-swatch {
        width: 20px;
        height: 20px;
    }
    
    /* Color Picker Popup Mobile Responsive */
    .hex-color-popup {
        min-width: 320px;
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .hex-color-popup-header {
        padding: 0.75rem;
    }
    
    .hex-color-popup-title {
        font-size: 0.9rem;
    }
    
    .hex-color-popup-close {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .enhanced-color-picker {
        padding: 1rem;
    }
    
    .enhanced-color-picker .color-preview {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .color-swatch-grid {
        grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr));
        gap: 0.5rem;
    }
    
    .color-swatch {
        width: 2rem;
        height: 2rem;
    }
    
    /* Hexagonal Color Picker Small Mobile */
    .hexagonal-color-picker .hex-color-indicator {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .hexagonal-color-picker .color-label {
        font-size: 0.8rem;
    }
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Templates */
.template-card {
    position: relative;
    background: #374151;
    border-radius: 0.5rem;
    padding: 0.3rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.template-card:hover {
    background: #4b5563;
}

.template-card.selected {
    border-color: #3b82f6;
}

.template-preview-frame {
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background: #1f2937;
    height: 8rem;
    display: flex;
    flex-direction: column;
}

.template-content-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.template-content-preview .single-video-preview {
    gap: 0;
}

/* Channel Banner */
.channel-banner {
    width: 100%;
    height: 2rem;
    background: linear-gradient(to right, #dc2626, #b91c1c);
    border-radius: 0.25rem;
    overflow: hidden;
    position: relative;
}

.banner-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
}

/* Channel Header */
.channel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.channel-avatar {
    width: 1rem;
    height: 1rem;
    background: #4b5563;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-info {
    flex: 1;
}

.channel-title-line {
    width: 2rem;
    height: 0.25rem;
    background: #9ca3af;
    border-radius: 0.125rem;
    margin-bottom: 0.25rem;
}

.channel-subtitle-line {
    width: 1.5rem;
    height: 0.25rem;
    background: #6b7280;
    border-radius: 0.125rem;
}

/* Content Grid */
.content-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.video-preview-item {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-thumbnail {
    width: 100%;
    height: 60%;
    background: #4b5563;
    border-radius: 0.25rem 0.25rem 0 0;
    position: relative;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 0.5rem 0.5rem;
    background-position: 0 0, 0 0.25rem, 0.25rem -0.25rem, -0.25rem 0;
    opacity: 0.3;
}

/* Remove all overlays and background when playing inline to allow video interaction */
.video-thumbnail.playing-inline::before {
    display: none !important;
}

.video-thumbnail.playing-inline::after {
    display: none !important;
}

.video-thumbnail.playing-inline {
    background: #000000 !important;
    background-color: #000000 !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    padding-bottom: 0 !important;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16/9) {
    .video-thumbnail.playing-inline {
        height: 0 !important;
        padding-bottom: 56.25% !important;
    }
}

.video-thumbnail.playing-inline iframe {
    background: #000000 !important;
    background-color: #000000 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    border: none !important;
}

/* Hide play button and duration when playing inline */
.video-item:has(.video-thumbnail.playing-inline) .play-button,
.video-item:has(.video-thumbnail.playing-inline) .video-duration {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.video-thumbnail::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.video-info {
    padding: 0.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-title-line {
    width: 100%;
    height: 0.5rem;
    background: #9ca3af;
    border-radius: 0.125rem;
    margin-bottom: 0.25rem;
}

.video-meta-line {
    width: 60%;
    height: 0.375rem;
    background: #6b7280;
    border-radius: 0.125rem;
}

/* Video Grid Preview */
.video-grid-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    height: 100%;
}

.video-grid-item {
    background: #4b5563;
    border: 1px solid #6b7280;
    border-radius: 0.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-grid-item::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #dc2626;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    opacity: 0.7;
}

/* Single Video Preview */
.single-video-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #2a2e37;
    border-radius: 0.375rem;
    overflow: hidden;
    border: none;
    box-shadow: none;
}

.template-content-preview .single-video-preview {
    background: transparent;
    height: 100%;
}

.single-video-thumbnail {
    background: #2a2e37;
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.play-button-center svg {
    width: 0.875rem;
    height: 0.875rem;
    fill: #dc2626;
    margin-left: 2px; /* Slight offset for visual centering of play icon */
}

.single-video-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
}

.video-title-line-full {
    width: 100%;
    height: 0.75rem;
    background: #4a4f58;
    border-radius: 0.125rem;
}

.video-meta-line-full {
    width: 60%;
    height: 0.5rem;
    background: #4a4f58;
    border-radius: 0.125rem;
}

.video-description-line {
    width: 100%;
    height: 0.5rem;
    background: #4a4f58;
    border-radius: 0.125rem;
    margin-top: 0.25rem;
}

.video-description-line::after {
    content: '';
    display: block;
    width: 80%;
    height: 0.5rem;
    background: #4a4f58;
    border-radius: 0.125rem;
    margin-top: 0.375rem;
}

/* Template Info */
.template-info {
    margin-top: 0.75rem;
    text-align: center;
}

.template-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    margin: 0;
}

/* Template Checkmark */
.template-checkmark {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 20;
}

/* Sort Buttons */
.sort-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    color: white;
}

.sort-btn.active {
    background: #000;
    color: white;
}

.sort-btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.sort-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Source Buttons */
.source-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.source-btn:hover {
    color: white;
}

.source-btn.active {
    background: #000;
    color: white;
}

.source-btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.source-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Slider Location Buttons - Same as Source Buttons */
.slider-location-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.slider-location-btn:hover {
    color: white;
}

.slider-location-btn.active {
    background: #000;
    color: white;
}

.slider-location-btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.slider-location-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Slider Direction Buttons - Same as Slider Location Buttons */
.slider-direction-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}

.slider-direction-btn:hover {
    color: white;
}

.slider-direction-btn.active {
    background: #000;
    color: white;
}

.slider-direction-btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.slider-direction-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Slider Options Container */
.slider-options-container {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

.slider-options-container h3 {
    color: #f9fafb;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-options-container h3::before {
    content: '⚙️';
    font-size: 1.125rem;
}

/* Slider Option Items */
.slider-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #374151;
    transition: all 0.2s ease;
}

/* Items with buttons (like Popup Type) should stack vertically */
.slider-option-item:has(.bg-gray-800) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.slider-option-item:last-child {
    border-bottom: none;
}

/* Ensure buttons container takes full width */
.slider-option-item > .bg-gray-800 {
    width: 100%;
}

.slider-option-label {
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: calc(100% - 3rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Labels in items with buttons should be full width */
.slider-option-item:has(.bg-gray-800) .slider-option-label {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
}

.slider-option-description {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* Enhanced Checkboxes */
.slider-checkbox {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #4b5563;
    border-radius: 0.375rem;
    background: #1f2937;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider-checkbox:hover {
    border-color: #6b7280;
    background: #374151;
    transform: scale(1.05);
}

.slider-checkbox:checked {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}

.slider-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Slider Input and Select Styles */
.slider-input, .slider-select {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #f9fafb;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.slider-input:focus, .slider-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.slider-input:hover, .slider-select:hover {
    border-color: #6b7280;
}

.slider-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.slider-checkbox:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    ring-offset: 2px;
    ring-offset-color: #1f2937;
}

/* Hide arrows and dots when navigation arrows are disabled */
.slide-navigation.hide-arrows .slide-nav-btn {
    display: none !important;
}

/* Hide pagination dots when pagination is disabled */
.slide-navigation .page-numbers[style*="display: none"],
.slide-navigation.hide-pagination .page-numbers {
    display: none !important;
}


/* Hide slider direction when bottom is selected */
.slider-location-bottom .slider-direction-container {
    display: none;
}

/* Show slider direction when center is selected */
.slider-location-center .slider-direction-container {
    display: block;
}

/* Vertical Slider Direction */
.slide-navigation.vertical-direction {
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 0 !important;
    height: 100% !important;
}

/* Vertical direction: SVG already points up/down, so no rotation needed */
.slide-navigation.vertical-direction .slide-nav-btn {
    transform: none !important;
}

/* Ensure vertical direction is maintained when center-positioned */
.slide-navigation.center-positioned.vertical-direction {
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 0 !important;
    height: 100% !important;
}

.slide-navigation.center-positioned.vertical-direction .slide-nav-btn {
    transform: none !important;
}

/* Reset transform when NOT vertical-direction */
.slide-navigation:not(.vertical-direction) .slide-nav-btn {
    transform: none !important;
}

.slide-navigation.vertical-direction .slide-nav-btn.slide-prev {
    order: 1;
}

.slide-navigation.vertical-direction .slide-nav-btn.slide-next {
    order: 3;
}

/* Reset order when NOT vertical-direction */
.slide-navigation:not(.vertical-direction) .slide-nav-btn.slide-prev {
    order: initial;
}

.slide-navigation:not(.vertical-direction) .slide-nav-btn.slide-next {
    order: initial;
}

.slide-navigation.vertical-direction .page-numbers {
    order: 2;
    flex-direction: column !important;
    gap: 0.2rem !important;
}

/* Slider Navigation Positioning */
.slide-navigation.center-positioned {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(-50%) !important;
    z-index: 10001 !important;
    pointer-events: none !important;
    margin-top: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 10px !important;
}

/* Mobile-specific styles for slide navigation */
@media (max-width: 768px) {
    .slide-navigation {
        padding: 0.5rem 0.5rem !important;
        gap: 0.25rem !important;
    }
    
    .slide-navigation.center-positioned {
        padding: 0 6px !important;
        gap: 0.25rem !important;
    }
    
    .slide-nav-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        flex-shrink: 0 !important;
    }
    
    .slide-nav-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .page-numbers {
        gap: 0.125rem !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
        padding: 0 0.125rem !important;
    }
    
    .page-number {
        min-width: 24px !important;
        height: 28px !important;
        padding: 4px 6px !important;
        font-size: 11px !important;
    }
    
    .page-ellipsis {
        min-width: 20px !important;
        height: 28px !important;
        font-size: 11px !important;
        padding: 0 2px !important;
    }
}

.slide-navigation.center-positioned .slide-nav-btn,
.slide-navigation.center-positioned .page-number {
    pointer-events: auto !important;
}

/* Separate container for page numbers when navigation is center or vertical */
.videos-section {
    position: relative;
}

.page-numbers-bottom-container {
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    z-index: 10002 !important;
    display: flex !important;
    gap: 0.2rem !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    margin-top: 0.5rem !important;
}

.page-numbers-bottom-container .page-numbers {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.slide-navigation.bottom-positioned {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* Layout Categories */
.layout-categories-list {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.layout-categories-list .space-y-2 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.layout-category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    color: #e5e7eb;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

.layout-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.layout-category-btn:hover::before {
    left: 100%;
}

.layout-category-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border-color: #60a5fa;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3), 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.layout-category-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.layout-category-btn span {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.layout-category-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.layout-category-btn:hover svg {
    color: #60a5fa;
    transform: translateX(4px);
}

/* Layout Category Detail */
.layout-category-detail {
    position: relative;
    animation: slideInUp 0.4s ease-out;
}

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

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

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #374151;
    background: #111827;
    padding-top: 1rem;
    margin-top: -1rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 2px solid rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.back-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.4);
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.back-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 8px 25px rgba(59, 130, 246, 0.25);
}

/* Subtle pulse animation for back button */
@keyframes backButtonPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
    }
}

.back-btn {
    animation: backButtonPulse 3s ease-in-out infinite;
}

.back-btn:hover {
    animation: none;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .back-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }
    
    .back-btn svg {
        width: 1.125rem;
        height: 1.125rem;
    }
}

@media (max-width: 480px) {
    .back-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .back-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

.back-btn:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.back-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.back-btn:hover svg {
    transform: translateX(-6px) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3));
}

.category-title {
    flex: 1;
    text-align: end;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-content {
    max-width: 36rem;
    margin: 0 auto;
    max-height: calc(100vh - 200px);
}

/* Enhanced Form Controls */
.category-content .space-y-6 > * + * {
    margin-top: 1.5rem;
}

.category-content .bg-gray-800 {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-radius: 0.5rem;
    padding: 0.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Layout Input Boxes - Clean HTML/CSS */
.layout-input-box {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.layout-input-label {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.layout-input-field {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.layout-input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.layout-input-field:hover {
    border-color: #6b7280;
}

.category-content .bg-gray-800.flex:not(.flex-col) {
    align-items: center;
    justify-content: space-between;
}

.category-content .text-lg {
    font-size: 1rem;
    font-weight: 600;
    color: #f3f4f6;
    padding-left: 4px;
}

.category-content .text-white {
    color: #f3f4f6;
}

.category-content .text-base {
    font-size: 1rem;
    font-weight: 500;
    color: #d1d5db;
    padding: 4px;
}

.category-content .mb-1 {
    margin-bottom: 0.5rem;
}

/* Modern Brand Toggle Switch */
.flipswitch {
  position: relative;
  width: 48px;
  height: 24px;
}

.flipswitch input[type=checkbox] {
  display: none;
}

.flipswitch-label {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: #374151;
  border-radius: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #4b5563;
}

.flipswitch-inner {
  display: none;
}

.flipswitch-switch {
  width: 18px;
  height: 18px;
  background: #9ca3af;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flipswitch-cb:checked + .flipswitch-label {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: #3b82f6;
}

.flipswitch-cb:checked + .flipswitch-label .flipswitch-switch {
  background: #ffffff;
  transform: translateX(24px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.flipswitch-label:hover {
  border-color: #60a5fa;
}

.flipswitch-cb:checked + .flipswitch-label:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border-color: #60a5fa;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .flipswitch {
    width: 44px;
    height: 22px;
  }
  
  .flipswitch-switch {
    width: 16px;
    height: 16px;
    top: 2px;
  }
  
  .flipswitch-cb:checked + .flipswitch-label .flipswitch-switch {
    transform: translateX(22px);
  }
}

/* Focus states for accessibility */
.flipswitch-cb:focus + .flipswitch-label {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Active state animation */
.flipswitch-label:active .flipswitch-switch {
  transform: scale(0.95);
}

.flipswitch-cb:checked + .flipswitch-label:active .flipswitch-switch {
  transform: translateX(24px) scale(0.95);
}

/* Checked state pulse animation */
@keyframes togglePulse {
  0% { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 2px 12px rgba(59, 130,246, 0.6); }
  100% { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }
}

.flipswitch-cb:checked + .flipswitch-label .flipswitch-switch {
  animation: togglePulse 2s ease-in-out infinite;
}

/* Header Layout Controls Container - Force Column Layout */
#header-layout-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

#header-layout-controls > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

/* Header Elements Controls - Now uses slider-options-container styling */

/* Appearance Categories List */
.appearance-categories-list {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.appearance-categories-list .space-y-2 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.appearance-category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    color: #e5e7eb;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

.appearance-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.appearance-category-btn:hover::before {
    left: 100%;
}

.appearance-category-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border-color: #60a5fa;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3), 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.appearance-category-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.appearance-category-btn span {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.appearance-category-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.appearance-category-btn:hover svg {
    color: #60a5fa;
    transform: translateX(4px);
}

/* Appearance Category Detail */
.appearance-category-detail {
    display: none;
    position: relative;
    animation: slideInUp 0.4s ease-out;
}

.appearance-category-detail.active {
    display: block;
}

#header-elements-controls > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

/* Header Elements Controls now uses slider-options-container styling */

/* Enhanced Header Layout Buttons */
.header-layout-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header-layout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.header-layout-btn span {
    position: relative;
    z-index: 2;
}

.header-layout-btn:hover {
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.header-layout-btn:hover::before {
    opacity: 1;
}

.header-layout-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.header-layout-btn:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.header-layout-btn:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Accent Header Layout Styles */
.accent-header {
    position: relative;
    max-width: 1200px;
    width: 100%;
    height: 340px;
    background: var(--header-color, #ffffff);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.5rem;
}

/* Adjust accent header when banner is hidden */
.accent-header.no-banner {
    height: auto;
    min-height: 200px;
    padding: 2rem 0;
}

.accent-banner-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-color, #ffffff);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    margin: 0.5rem;
    border-radius: 12px;
}

.accent-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-banner-overlay-color, rgba(var(--header-color-rgb, 255, 255, 255), 0.5));
    z-index: 1;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.accent-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.accent-logo-container {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}

.accent-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.accent-profile-image {
    width: 100px;
    height: 100px;
    background: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.accent-profile-text {
    color: #fbbf24;
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
}

.accent-channel-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--header-channel-name-color, #111827);
    text-align: center;
}

.accent-channel-description {
    font-size: 0.875rem;
    color: var(--header-channel-description-color, #18191a);
    text-align: center;
    margin: 0 auto;
    max-width: 600px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.accent-stats {
    font-size: 12px;
    color: var(--header-counters-color, #18191a);
    margin: 0 auto;
    text-align: center;
}

.accent-subscribe-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.accent-subscribe-btn {
    position: relative;
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: transparent;
    border: 1px solid var(--header-subscribe-button-color, #cd201f);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}


.accent-subscribe-btn:active {
    transform: scale(1.01);
}

.accent-subscribe-btn .icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: transform 0.5s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 33px;
}

.accent-subscribe-btn .icon svg {
    display: block;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
}

.accent-subscribe-btn .icon::before {
    position: absolute;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: -1;
    content: '';
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: var(--header-subscribe-button-color, #cd201f);
}

.accent-subscribe-btn:hover .icon {
    transform: translateX(96px) translateY(-50%);
    transition: transform 0.5s;
}

.accent-subscribe-btn .text1 {
    font-size: 15px;
    font-weight: 600;
    margin-left: 22%;
    color: var(--header-subscribe-button-color, #cd201f);
    transition: color 0.3s;
}

.accent-subscribe-btn:hover .text1 {
    color: white;
}

.accent-subscribe-btn:hover .icon::before {
    background-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.accent-subscribe-btn:hover {
    border-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.accent-subscribe-btn .text2 {
    position: absolute;
    left: -60px;
    font-weight: 700;
    font-size: 14px;
    color: white;
    transition: transform 0.6s;
}

.accent-subscribe-btn:hover .text2 {
    transform: translateX(100px);
    transition: transform 0.6s;
}

/* Minimal Header */
.minimal-header {
    background: var(--header-color, #ffffff);
    overflow: hidden;
    margin-bottom: 1rem;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 0.5rem 0;
}

.minimal-header-mobile {
    height: 250px !important;
}

.minimal-header-tablet {
    height: 250px !important;
}

.minimal-banner {
    height: 140px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Hide banner container when no banner content */
.minimal-banner:empty {
    display: none;
}

.minimal-banner-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
}

.minimal-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--header-banner-overlay-color, rgba(var(--header-color-rgb, 255, 255, 255), 0.6));
    z-index: 1;
}

.minimal-subheader {
    position: absolute;
    top: 2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 180px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3rem;
    z-index: 2;
}

/* Adjust subheader position when banner is hidden */
.minimal-header.no-banner .minimal-subheader {
    position: relative;
    top: auto;
    transform: none;
    padding: 2rem;
}

.minimal-subheader-mobile {
    position: absolute;
    top: 5%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    background: transparent;
    padding: 1rem 2rem;
    z-index: 2;
    width: 100%;
}

.minimal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    width: auto;
    margin: 0 auto;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 3;
}

.minimal-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.minimal-logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.minimal-profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    margin-right: 0;
}

.minimal-profile-text {
    color: #fbbf24;
    font-weight: 700;
    font-size: 1.25rem;
    text-align: center;
}

.minimal-channel-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.minimal-channel-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--header-channel-name-color, #111827);
    display: block;
}

.minimal-channel-description {
    font-size: 0.875rem;
    color: var(--header-channel-description-color, #18191a);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
    max-width: 700px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.minimal-stats {
    font-size: 12px;
    color: var(--header-counters-color, #18191a);
    margin: 0.25rem 0 0 0;
    display: block;
}

.minimal-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 1rem;
}

.minimal-subscribe-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.minimal-subscribe-btn {
    position: relative;
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: transparent;
    border: 1px solid var(--header-subscribe-button-color, #cd201f);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.minimal-subscribe-btn:active {
    transform: scale(1.01);
}

.minimal-subscribe-btn .icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: transform 0.5s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 33px;
}

.minimal-subscribe-btn .icon svg {
    display: block;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
}

.minimal-subscribe-btn .icon::before {
    position: absolute;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: -1;
    content: '';
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: var(--header-subscribe-button-color, #cd201f);
}

.minimal-subscribe-btn:hover .icon {
    transform: translateX(96px) translateY(-50%);
    transition: transform 0.5s;
}

.minimal-subscribe-btn .text1 {
    font-size: 15px;
    font-weight: 600;
    margin-left: 22%;
    color: var(--header-subscribe-button-color, #cd201f);
    transition: color 0.3s;
}

.minimal-subscribe-btn:hover .text1 {
    color: white;
}

.minimal-subscribe-btn:hover .icon::before {
    background-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.minimal-subscribe-btn:hover {
    border-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.minimal-subscribe-btn .text2 {
    position: absolute;
    left: -60px;
    font-weight: 700;
    font-size: 14px;
    color: white;
    transition: transform 0.6s;
}

.minimal-subscribe-btn:hover .text2 {
    transform: translateX(100px);
    transition: transform 0.6s;
}

.minimal-subscriber-count {
    font-size: 12px;
    color: var(--header-counters-color, #18191a);
    font-weight: 500;
    text-align: center;
}

/* Responsive styles for minimal header */
@media (max-width: 768px) {
    .minimal-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .minimal-left {
        flex-direction: column;
        gap: 1rem;
    }
    
    .minimal-subheader {
        padding: 1rem;
    }
}

/* Enhanced Select and Input Styles */
.category-content select,
.category-content input[type="number"] {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border: 2px solid #6b7280;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-content select:focus,
.category-content input[type="number"]:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    background: #1f2937;
}

.category-content select:hover,
.category-content input[type="number"]:hover {
    border-color: #9ca3af;
}

/* Typography Controls - Enhanced Styling */
.typography-control-group {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.typography-control-group:hover {
    border-color: #6b7280;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.typography-control-header {
    margin-bottom: 1rem;
}

.typography-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0;
}

.typography-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.typography-select-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.typography-select {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border: 2px solid #6b7280;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.typography-select:hover {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #4b5563 0%, #475569 100%);
}

.typography-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.typography-select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #9ca3af;
    transition: all 0.3s ease;
}

.typography-select-wrapper:hover::after,
.typography-select-wrapper:focus-within::after {
    border-top-color: #60a5fa;
}

.typography-hint {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Font Size Controls */
.font-size-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.font-size-slider-container {
    flex: 1;
    position: relative;
}

.font-size-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #374151 0%, #4b5563 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1f2937;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
    transition: all 0.3s ease;
}

.font-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.6);
}

.font-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1f2937;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
    transition: all 0.3s ease;
}

.font-size-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.6);
}

.font-size-slider::-moz-range-track {
    background: linear-gradient(to right, #374151 0%, #4b5563 100%);
    height: 8px;
    border-radius: 4px;
}

.font-size-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.font-size-label-min,
.font-size-label-max {
    font-weight: 500;
}

.font-size-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 2px solid #4b5563;
    border-radius: 0.75rem;
    padding: 0.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.font-size-input-wrapper:hover {
    border-color: #6b7280;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.font-size-input-wrapper:focus-within {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    transform: translateY(-1px);
}

.font-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border: 1px solid #6b7280;
    border-radius: 0.5rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0;
    outline: none;
}

.font-size-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-color: #60a5fa;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
}

.font-size-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(96, 165, 250, 0.2);
}

.font-size-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2.5;
}

.font-size-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.font-size-btn:disabled:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border-color: #6b7280;
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.font-size-input-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    padding: 0.5rem 0.75rem;
    min-width: 4.5rem;
}

.font-size-input {
    width: 2.5rem;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.font-size-input::-webkit-outer-spin-button,
.font-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.font-size-input:focus {
    color: #60a5fa;
}

.font-size-input::placeholder {
    color: #6b7280;
    opacity: 0.6;
}

.font-size-input-group {
    flex: 1;
    justify-content: center;
}

.font-size-unit {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 600;
    user-select: none;
    letter-spacing: 0.05em;
    opacity: 0.9;
    transition: color 0.2s ease;
}

.font-size-input-wrapper:focus-within .font-size-unit {
    color: #60a5fa;
    opacity: 1;
}

.font-size-preview-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.font-size-preview-label {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
}

.font-size-preview-text {
    flex: 1;
    text-align: center;
    color: #60a5fa;
    font-weight: 700;
    font-size: 16px;
    transition: font-size 0.2s ease;
    line-height: 1.2;
    padding: 0.25rem 0;
    text-shadow: 0 2px 4px rgba(96, 165, 250, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .layout-categories-list,
    .appearance-categories-list {
        padding: 1rem;
        border-radius: 0.75rem;
    }
    
    .layout-category-btn,
    .appearance-category-btn {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
    
    .layout-category-detail,
    .appearance-category-detail {
        padding: 1.5rem;
        border-radius: 0.75rem;
    }
    
    .category-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .back-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .layout-categories-list,
    .appearance-categories-list {
        padding: 0.75rem;
    }
    
    .layout-category-btn,
    .appearance-category-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .layout-category-detail,
    .appearance-category-detail {
        padding: 1rem;
    }
    
    .category-content .bg-gray-800 {
        padding: 1.25rem;
    }
}





/* Preview Panel */
.preview-panel {
    width: 70%;
    background: white;
    overflow-y: auto;
    height: 100%;
    margin-left: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-panel:has(.widget-preview-content:has(.loading-overlay)) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}



.widget-preview {
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: auto;
    background: white;
    transition: all 0.3s;
    position: relative;
}

.widget-preview:has(.widget-preview-content:has(.loading-overlay)) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 500px !important;
    overflow: hidden !important;
}

.widget-preview:has(.widget-preview-content:has(.loading-overlay)),
.widget-preview:has(.youtube-widget-container .youtube-widget .widget-preview-content:has(.loading-overlay)) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Preview Mode Styles */
.widget-preview.preview-desktop {
    max-width: 100%;
    margin: 0;
}

.widget-preview.preview-tablet {
    max-width: 768px;
    margin: 0 auto;
    border: 8px solid #374151;
    border-radius: 1rem;
    height: calc(100% - 16px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.widget-preview.preview-mobile {
    max-width: 375px;
    margin: 0 auto;
    border: 8px solid #374151;
    border-radius: 1.5rem;
    height: calc(100% - 16px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Widget Content Preview Mode Styles - Universal (works for both preview and embedded) */
.widget-content.preview-desktop,
.widget-preview-content,
.youtube-widget {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* Ensure grid content is not clipped */
    overflow-x: visible;
}

/* Override max-width for single-video template to allow full-width centering */
.widget-preview-content:has(.videos-section .videos-grid.single-video-template),
.youtube-widget:has(.videos-section .videos-grid.single-video-template) {
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.widget-content.preview-tablet {
    max-width: 768px;
    margin: 0 auto;
    border: 8px solid #374151;
    border-radius: 1rem;
    height: calc(100% - 16px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.widget-content.preview-mobile {
    max-width: 375px;
    margin: 0 auto;
    border: 8px solid #374151;
    border-radius: 1.5rem;
    height: calc(100% - 16px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Responsive Video Grid for Preview Modes */
.widget-preview.preview-desktop .video-grid {
    grid-template-columns: repeat(3, 1fr);
}

.widget-preview.preview-tablet .video-grid {
    grid-template-columns: repeat(2, 1fr);
}

.widget-preview.preview-mobile .video-grid {
    grid-template-columns: 1fr;
}

/* Widget Content Responsive Video Grid - Universal (works for both preview and embedded) */
.widget-content.preview-desktop .videos-grid,
.youtube-widget .videos-grid {
    grid-template-columns: repeat(3, 1fr);
    /* Ensure proper width calculation and prevent clipping */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

/* Preview Mode Specific Grid Columns - Must override media queries */
.widget-preview-content.preview-desktop .videos-grid,
.widget-preview-content.preview-desktop .videos-grid,
.widget-content.preview-desktop .videos-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

.widget-preview-content.preview-tablet .videos-grid,
.widget-content.preview-tablet .videos-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.widget-preview-content.preview-mobile .videos-grid,
.widget-content.preview-mobile .videos-grid {
    grid-template-columns: 1fr !important;
}

/* Also apply to videos-grid with preview mode classes directly */
.videos-grid.preview-desktop {
    grid-template-columns: repeat(3, 1fr) !important;
}

.videos-grid.preview-tablet {
    grid-template-columns: repeat(2, 1fr) !important;
}

.videos-grid.preview-mobile {
    grid-template-columns: 1fr !important;
}

/* Ensure video items in preview don't overflow */
.widget-preview-content .videos-grid .video-item,
#widget-preview .videos-grid .video-item {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Embedded widget responsive video grid (only when NOT in preview mode) */
.widget-preview-content:not(.preview-desktop):not(.preview-tablet):not(.preview-mobile) .videos-grid {
    /* Use media queries only when preview mode classes are not present */
}

@media (min-width: 769px) {
    .widget-preview-content:not(.preview-desktop):not(.preview-tablet):not(.preview-mobile) .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .widget-preview-content:not(.preview-desktop):not(.preview-tablet):not(.preview-mobile) .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .widget-preview-content:not(.preview-desktop):not(.preview-tablet):not(.preview-mobile) .videos-grid {
        grid-template-columns: 1fr;
    }
}

/* Widget Content Responsive Header Styles - REMOVED DUPLICATES */

/* CLASSIC HEADER MOBILE OPTIMIZATION - MOBILE ONLY */
@media (max-width: 768px) {
    .classic-subheader .classic-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        width: 100% !important;
    }

    .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        width: 100% !important;
        text-align: center !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-profile-image {
        margin: 0 auto !important;
        display: block !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-channel-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name {
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description {
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats {
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .classic-subheader .classic-content .classic-header-row .classic-subscribe-section {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
}

/* MINIMAL HEADER MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .minimal-banner {
        height: 250px !important;
    }
    
    .minimal-banner-image {
        background-size: 150% !important;
        background-position: center !important;
    }
    
    .accent-banner-background {
        background-size: 150% !important;
        background-position: center !important;
    }
    
    .classic-banner-image {
        background-size: 150% !important;
        background-position: center !important;
    }
    
    .minimal-subheader {
        top: 2px !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        height: 250px !important;
        padding: 1rem !important;
        padding-top: 2rem !important;
    }
    
    .minimal-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .minimal-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .minimal-channel-info {
        text-align: center !important;
        width: 100% !important;
    }

    .minimal-stats {
        text-align: center !important;
        width: 100% !important;
    }

    .minimal-right {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
}

/* ACCENT HEADER MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .accent-content {
        gap: 0 !important;
    }

    .accent-logo-container {
        margin: 0 auto !important;
        display: block !important;
    }

    .accent-channel-info {
        text-align: center !important;
        width: 100% !important;
    }

    .accent-channel-description {
        text-align: center !important;
        width: 100% !important;
    }

    .accent-stats {
        text-align: center !important;
        width: 100% !important;
    }

    .accent-subscribe-section {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
}

/* Widget Content Mobile Styles - SMALLER BREAKPOINTS */
@media (max-width: 480px) {
    /* CLASSIC CONTENT SMALL MOBILE */
    .classic-content {
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }
    
    .classic-content .classic-stats {
        font-size: 0.8rem !important;
    }
    
    /* MINIMAL HEADER SMALL MOBILE */
    .widget-content .minimal-content {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .widget-content .minimal-left {
        gap: 0.5rem !important;
    }
    
    .widget-content .minimal-stats {
        font-size: 0.8rem !important;
    }
    
    /* ACCENT HEADER SMALL MOBILE */
    .widget-content .accent-content {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .widget-content .accent-channel-description {
        font-size: 0.8rem !important;
        max-width: 250px !important;
    }
    
    .widget-content .accent-stats {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 360px) {
    /* CLASSIC CONTENT EXTRA SMALL MOBILE */
    .classic-content {
        gap: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    .classic-content .classic-stats {
        font-size: 0.75rem !important;
    }
    
    /* MINIMAL HEADER EXTRA SMALL MOBILE */
    .widget-content .minimal-content {
        padding: 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .widget-content .minimal-left {
        gap: 0.4rem !important;
    }
    
    .widget-content .minimal-stats {
        font-size: 0.75rem !important;
    }
    
    /* ACCENT HEADER EXTRA SMALL MOBILE */
    .widget-content .accent-content {
        padding: 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .widget-content .accent-channel-description {
        font-size: 0.75rem !important;
        max-width: 200px !important;
    }
    
    .widget-content .accent-stats {
        font-size: 0.75rem !important;
    }
}


@media (max-width: 768px) {
    /* Classic Header Mobile Styles */
    .classic-stats {
        white-space: normal !important;
        overflow: visible !important;
        word-break: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        display: block !important;
        width: 100% !important;
        line-height: 1.4 !important;
        margin: 0.5rem 0 !important;
        text-align: center !important;
    }
    
    
    /* Responsive sizing for all headers */
    .classic-profile-image,
    .minimal-profile-image,
    .accent-profile-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .classic-channel-name,
    .minimal-channel-name,
    .accent-channel-name {
        font-size: 1.25rem !important;
        text-align: center !important;
    }
    
    .channel-name-link {
        font-size: 1.25rem !important;
        text-align: center !important;
    }
    
    .classic-channel-description,
    .minimal-channel-description,
    .accent-channel-description {
        font-size: 0.875rem !important;
        text-align: center !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    .classic-subscribe-btn,
    .minimal-subscribe-btn,
    .accent-subscribe-btn {
        width: 120px !important;
        height: 35px !important;
        margin: 0 auto !important;
    }
}

/* Widget Content Preview Styles - REMOVED DUPLICATES */

/* Widget Content Accent Header Responsive Styles - REMOVED DUPLICATES */

/* Video Grid Template Responsive for Widget */
.widget-content [data-template="video-grid"].preview-desktop .videos-grid {
    grid-template-columns: repeat(4, 1fr);
}

.widget-content [data-template="video-grid"].preview-tablet .videos-grid {
    grid-template-columns: repeat(3, 1fr);
}

.widget-content [data-template="video-grid"].preview-mobile .videos-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Saved Widgets Page */
.saved-widgets-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: #f9fafb;
    overflow-y: auto;
}

.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.sm-px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.lg-px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Saved Widgets Content */
.saved-widgets-content {
    min-height: 400px;
}

/* Old saved widgets styles removed - using enhanced styles below */

/* Old saved widget styles removed - using new enhanced styles below */

/* Removed duplicate delete-widget-btn rules that were conflicting with grid view styling */

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Delete Modal Styles */
.delete-modal-content {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.delete-modal-header {
    margin-bottom: 2rem;
}

.delete-icon-container {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
    position: relative;
    overflow: hidden;
}

.delete-icon-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 50%;
}

.delete-icon-container svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    z-index: 1;
    position: relative;
}

.delete-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.delete-modal-message {
    color: #9ca3af;
    font-size: 1.2rem;
    line-height: 1.5;
    margin: 0;
    margin-left: auto;
    margin-right: auto;
}

.delete-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    width: 100%;
    max-width: 300px;
}

.delete-modal-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex: 1;
}

.delete-modal-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.delete-modal-actions .btn:hover::before {
    left: 100%;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-delete:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-delete:disabled:hover {
    background: #d1d5db;
    transform: none;
    box-shadow: none;
}

#delete-confirm-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animation for modal appearance */
.delete-modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    .delete-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .delete-modal-actions {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }
    
    .delete-modal-actions .btn {
        width: 100%;
        flex: 1 1 auto;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002; /* Higher than fullscreen (1001) and auth modal (10000) */
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* App Type Selector Modal */
.app-type-modal-content {
    max-width: 600px;
    padding: 2rem;
}

.app-type-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-type-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.app-type-modal-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

.app-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.app-type-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.app-type-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.app-type-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0.75rem 0 0.5rem;
}

.app-type-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.app-type-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.app-type-icon.youtube {
    background: #ff0000;
    color: white;
}

.app-type-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.app-type-icon.tiktok {
    background: #000000;
    color: white;
}

.app-type-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.app-type-cancel-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.app-type-cancel-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* App Type Badges */
.app-type-tag,
.app-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    color: white;
    text-transform: capitalize;
}

.app-type-tag.youtube,
.app-type-badge.youtube {
    background: #ff0000;
}

.app-type-tag.instagram,
.app-type-badge.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.app-type-tag.tiktok,
.app-type-badge.tiktok {
    background: #000000;
}

.widget-tags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.widget-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.widget-card-title-row .app-type-badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* Delete Account Modal - needs higher z-index than auth overlay */
#delete-account-modal {
    z-index: 10001;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    justify-content: center;
}

/* Notification */
.notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10010; /* Higher than modal (10002) to appear on top */
    display: none;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    display: block;
    transform: translateX(0);
}

.notification-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-icon {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.notification-message {
    flex: 1;
}

.notification-message p {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.notification-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.notification-close svg {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .config-sidebar {
        width: 40%;
    }
    
    .preview-panel {
        width: 60%;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin: 1rem 0.5rem 0.5rem;
    }
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 12px 16px;
        position: relative;
        min-height: 74px; /* Ensure space for top row */
    }
    
    .header-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.75rem;
        flex: 0 0 auto !important;
        min-width: 0;
        flex-wrap: nowrap !important;
        height: 50px;
        margin-right: auto; /* Push to left, space for user-account on right */
        justify-content: flex-start !important;
    }
    
    .header-left .logo {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 50px;
    }
    
    .header-left .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .header-left .title {
        flex: 1;
        min-width: 0;
        flex-shrink: 1;
        display: flex !important;
        align-items: center !important;
        height: 50px;
    }
    
    .title h1 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        line-height: 1.2;
        display: flex;
        align-items: center;
    }
    
    /* Move user-account from header-nav to top row on mobile */
    .header-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .header-nav .user-account {
        position: absolute;
        top: 12px;
        right: 16px;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10;
        height: 50px; /* Match header-left height */
    }
    
    .header-nav .user-avatar-btn,
    .header-nav .user-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100%;
    }
    
    /* Hide login button when avatar container is visible */
    .header-nav .user-account .user-avatar-container[style*="display: flex"] ~ .user-btn,
    .header-nav .user-account .user-avatar-container[style*="display: block"] ~ .user-btn,
    .header-nav .user-account:has(.user-avatar-container[style*="display: flex"]) .user-btn,
    .header-nav .user-account:has(.user-avatar-container[style*="display: block"]) .user-btn {
        display: none !important;
    }
    
    /* Show login button when avatar container is hidden */
    .header-nav .user-account .user-avatar-container[style*="display: none"] ~ .user-btn,
    .header-nav .user-account:has(.user-avatar-container[style*="display: none"]) .user-btn,
    .header-nav .user-account:not(:has(.user-avatar-container[style*="display: flex"])):not(:has(.user-avatar-container[style*="display: block"])) .user-btn {
        display: flex !important;
    }
    
    /* When JavaScript sets display: block, convert to flex for proper layout */
    .header-nav .user-avatar-container[style*="display: block"] {
        display: flex !important;
    }
    
    /* Keep it hidden if JavaScript sets it to none */
    .header-nav .user-avatar-container[style*="display: none"] {
        display: none !important;
    }
    
    /* Default state - show as flex if no inline style */
    .header-nav .user-avatar-container:not([style*="display"]) {
        display: flex !important;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 0.5rem;
        min-width: 44px;
        justify-content: center;
    }
    
    .header-top .user-btn span {
        display: none;
    }
    
    .window-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
        min-height: auto !important;
        padding: 1rem !important;
        position: relative !important;
        z-index: 30 !important;
    }
    
    .window-title {
        width: calc(100% - 50px);
        order: 1;
        margin-right: auto;
        display: flex !important;
        align-items: center !important;
        height: auto;
        line-height: 1.5;
        margin: 0;
        padding: 0;
        min-height: 2.5rem;
    }
    
    .window-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        order: 3;
        justify-content: space-evenly;
        align-items: center;
        gap: 0.5rem;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    
    .window-actions * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .window-actions .preview-mode-switcher {
        display: flex !important;
        visibility: visible !important;
        order: 1;
        width: 100%;
        margin: 0;
        justify-content: space-evenly;
        flex-basis: 100%;
    }
    
    .window-actions .config-toggle-btn {
        display: flex !important;
        order: 2;
        width: calc(50% - 0.25rem);
        justify-content: center;
        align-items: center;
        margin: 0;
        flex-shrink: 0;
        height: auto;
        min-height: 2.5rem;
        padding: 0.5rem 1rem;
    }
    
    .window-actions .save-btn {
        order: 2;
        width: calc(50% - 0.25rem);
        justify-content: center;
        align-items: center;
        margin: 0;
        flex-shrink: 0;
        height: auto;
        min-height: 2.5rem;
        padding: 0.5rem 1rem;
    }
    
    /* When config is open, highlight the toggle button */
    .config-sidebar.mobile-open + .preview-panel .window-actions .config-toggle-btn,
    .window-actions .config-toggle-btn.active {
        background: #3b82f6 !important;
    }
    
    .window-actions .config-toggle-btn.active:hover {
        background: #2563eb !important;
    }
    
    .window-actions .fullscreen-btn {
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
        order: 2;
        z-index: 31;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 2.5rem;
        width: 2.5rem;
        margin: 0;
        padding: 0.5rem;
        transform: translateY(0);
    }
    
    .window-actions .new-widget-btn {
        order: 2;
        width: calc(30%);
        justify-content: center;
        align-items: center;
        margin: 0;
        flex-shrink: 0;
        display: none; /* Hidden by default */
        height: auto;
        min-height: 2.5rem;
        padding: 0.5rem 1rem;
    }
    
    /* When new-widget-btn is visible, all three buttons share the row */
    .window-actions:has(.new-widget-btn:not([style*="display: none"])) .config-toggle-btn {
        width: calc(30%) !important;
        order: 2;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        max-height: 2.75rem !important;
        padding: 0.5rem 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .window-actions:has(.new-widget-btn:not([style*="display: none"])) .save-btn {
        width: calc(30%) !important;
        order: 2;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        max-height: 2.75rem !important;
        padding: 0.5rem 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .window-actions:has(.new-widget-btn:not([style*="display: none"])) .new-widget-btn {
        width: calc(30%) !important;
        order: 2;
        display: flex !important;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        max-height: 2.75rem !important;
        padding: 0.5rem 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .window-content {
        flex-direction: column;
    }
    
    .config-sidebar {
        width: 100%;
        height: 600px;
        min-height: 600px;
        max-height: 75vh;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        margin-top: 0;
        display: none; /* Hidden by default on mobile */
    }
    
    .config-sidebar.mobile-open {
        display: flex !important;
    }
    
    .config-nav {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
    }
    
    .config-content {
        position: relative !important;
        top: auto !important;
        max-height: calc(100vh - 400px) !important;
    }
    
    .preview-panel {
        width: 100%;
        flex: 1;
        margin-left: 0;
    }
    
    .preview-frame.desktop {
        height: 400px;
    }
}

/* Widget Preview Styles (matching the original widget) */
.widget-preview {
    font-family: "Roboto", "Arial", sans-serif;
}

/* Tailwind-like Utility Classes */
.p-6 { padding: 1.5rem; }
.text-center { text-align: center; }
.mb-6 { margin-bottom: 1.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.bg-red-600 { background-color: #dc2626; }
.rounded-full { border-radius: 9999px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-4 { margin-bottom: 1rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.text-white { color: white; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-semibold { font-weight: 600; }
.text-gray-900 { color: #111827; }
.mb-2 { margin-bottom: 0.5rem; }
.text-gray-600 { color: #4b5563; }
.mb-6 { margin-bottom: 1.5rem; }
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.bg-white { background-color: white; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.p-4 { padding: 1rem; }
.border { border-width: 1px; }
.border-gray-200 { border-color: #e5e7eb; }
.w-full { width: 100%; }
.h-20 { height: 5rem; }
.bg-gray-200 { background-color: #e5e7eb; }
.rounded { border-radius: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.h-3 { height: 0.75rem; }
.bg-gray-300 { background-color: #d1d5db; }
.mb-1 { margin-bottom: 0.25rem; }
.h-2 { height: 0.5rem; }
.w-2\/3 { width: 66.666667%; }
.mt-6 { margin-top: 1.5rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-gray-500 { color: #6b7280; }

/* Additional Tailwind-like classes for source section */
.block { display: block; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.text-gray-300 { color: #d1d5db; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.w-full { width: 100%; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.bg-gray-800 { background-color: #1f2937; }
.border-gray-700 { border-color: #374151; }
.rounded-lg { border-radius: 0.5rem; }
.text-white { color: white; }
.placeholder-gray-400 { color: #9ca3af; }
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:border-transparent:focus { border-color: transparent; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-gray-400 { color: #9ca3af; }
.mt-1 { margin-top: 0.25rem; }
.bg-gray-800 { background-color: #1f2937; }
.p-1 { padding: 0.25rem; }
.flex { display: flex; }

/* Advanced Section specific styles */
.pt-4 { padding-top: 1rem; }
.space-y-3 > * + * {
    margin-top: 0.75rem;
}
.bg-blue-600 { background-color: #2563eb; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.bg-gray-600 { background-color: #4b5563; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.font-medium { font-weight: 500; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.rounded-lg { border-radius: 0.5rem; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; }
.duration-200 { transition-duration: 200ms; }
.gap-2 { gap: 0.5rem; }
.flex-1 { flex: 1 1 0%; }

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Preview specific - ensure loading overlay is centered */
#widget-preview .loading-overlay,
#widget-preview .widget-preview-content .loading-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.widget-preview-content {
    position: relative;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* Ensure grid content is not clipped */
    overflow-x: visible;
}

.widget-preview-content:has(.loading-overlay) {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 500px !important;
}

/* Ensure preview window centers the widget content when loading */
#widget-preview:has(.widget-preview-content:has(.loading-overlay)) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 500px !important;
}

#widget-preview .youtube-widget-container:has(.widget-preview-content:has(.loading-overlay)),
#widget-preview .youtube-widget:has(.widget-preview-content:has(.loading-overlay)) {
    min-height: 500px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

/* Ensure parent containers also have proper height and centering */
#widget-preview .youtube-widget-container,
#widget-preview .youtube-widget-container .youtube-widget {
    width: 100%;
    min-height: 500px;
}

#widget-preview .youtube-widget-container:has(.loading-overlay),
#widget-preview .youtube-widget-container .youtube-widget:has(.loading-overlay),
#widget-preview .youtube-widget:has(.widget-preview-content:has(.loading-overlay)) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 500px !important;
    width: 100% !important;
}


.loading-content {
    text-align: center;
    color: #374151;
    z-index: 1;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 1rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.loading-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.loading-content {
    text-align: center;
    color: white;
    z-index: 1;
    position: relative;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: rgba(255, 255, 255, 0.6);
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: rgba(255, 255, 255, 0.4);
    animation-delay: 0.4s;
}

.loading-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-text p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Classic Header */
.classic-header {
    background: var(--header-color, #ffffff);
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 0.5rem 0;
}

.classic-banner {
    height: 200px;
    background: var(--header-color, #ffffff);
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
}

.classic-banner-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.classic-subheader,
.youtube-widget .classic-subheader,
.widget-preview-content .classic-subheader {
    background: var(--header-color, #f8f9fa) !important;
    min-height: 100px;
    align-items: center;
    width: 100%;
    padding: 0 !important;
}

/* DESKTOP PREVIEW MODE - HORIZONTAL LAYOUT - Universal (works for both preview and embedded) */
.widget-content.preview-desktop .classic-subheader .classic-content,
.widget-preview-content .classic-subheader .classic-content,
.youtube-widget .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 1rem !important;
    gap: 1rem !important;
    align-items: center !important;
    text-align: left !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row,
.widget-preview-content .classic-subheader .classic-content .classic-header-row,
.youtube-widget .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-subscribe-section,
.widget-preview-content .classic-subheader .classic-content .classic-subscribe-section,
.youtube-widget .classic-subheader .classic-content .classic-subscribe-section {
    flex-shrink: 0 !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row,
.widget-preview-content .classic-subheader .classic-content .classic-header-row,
.youtube-widget .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
    text-align: left !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row .classic-profile-image,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-profile-image,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-profile-image {
    flex-shrink: 0 !important;
    order: 1 !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row .classic-channel-info,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-channel-info,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info {
    flex: 1 !important;
    order: 2 !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row .classic-subscribe-section,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-subscribe-section,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-subscribe-section {
    flex-shrink: 0 !important;
    order: 3 !important;
}

/* TABLET PREVIEW MODE - HORIZONTAL LAYOUT */
.widget-content.preview-tablet .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    max-width: 768px !important;
    width: 100% !important;
    margin: 0 auto !important;
    gap: 1rem !important;
    align-items: center !important;
    text-align: left !important;
}

.widget-content.preview-tablet .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
    text-align: left !important;
}

.classic-subheader .classic-content .classic-header-row .classic-profile-image,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-profile-image {
    flex-shrink: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.classic-subheader .classic-content .classic-header-row .classic-channel-info,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    align-items: flex-start !important;
    text-align: left !important;
    width: auto !important;
}

.classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.classic-subheader .classic-content .classic-header-row .classic-subscribe-section,
.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-subscribe-section {
    flex-shrink: 0 !important;
    width: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin: 0 !important;
}

/* DESKTOP PREVIEW MODE - CLASSIC LEFT */
.widget-content.preview-desktop .classic-left,
.widget-preview-content .classic-left,
.youtube-widget .classic-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.classic-profile-image {
    width: 100px;
    height: 100px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.classic-profile-text {
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.classic-channel-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.classic-channel-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.classic-channel-description {
    font-size: 0.875rem;
    color: var(--header-channel-description-color, #6b7280);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
    max-width: 95%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.classic-stats {
    font-size: 0.875rem;
    color: var(--header-counters-color, #6b7280);
    margin: 0;
}

/* DESKTOP PREVIEW MODE - CLASSIC RIGHT */
.widget-content.preview-desktop .classic-right,
.widget-preview-content .classic-right,
.youtube-widget .classic-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* DESKTOP PREVIEW MODE - MINIMAL HEADER */
.widget-preview.preview-desktop .minimal-banner {
    height: 180px !important;
}

.widget-preview.preview-desktop .minimal-subheader .minimal-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.widget-content.preview-desktop .minimal-subheader .minimal-content .minimal-left,
.widget-preview-content .minimal-subheader .minimal-content .minimal-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.widget-content.preview-desktop .minimal-subheader .minimal-content .minimal-right,
.widget-preview-content .minimal-subheader .minimal-content .minimal-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* DESKTOP PREVIEW MODE - ACCENT HEADER */
.widget-content.preview-desktop .accent-subheader .accent-content,
.widget-preview-content .accent-subheader .accent-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.widget-content.preview-desktop .accent-subheader .accent-content .accent-logo-container,
.widget-preview-content .accent-subheader .accent-content .accent-logo-container {
    flex-shrink: 0;
}

.widget-content.preview-desktop .accent-subheader .accent-content .accent-channel-info,
.widget-preview-content .accent-subheader .accent-content .accent-channel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.widget-content.preview-desktop .accent-subheader .accent-content .accent-subscribe-section,
.widget-preview-content .accent-subheader .accent-content .accent-subscribe-section {
    flex-shrink: 0;
}

.classic-subscribe-section {
    display: flex;
    align-items: center;
}

.classic-subscribe-btn {
    position: relative;
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: transparent;
    border: 1px solid var(--header-subscribe-button-color, #cd201f);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.classic-subscribe-btn:active {
    transform: scale(1.01);
}

.classic-subscribe-btn .icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: transform 0.5s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 33px;
}

.classic-subscribe-btn .icon svg {
    display: block;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
}

.classic-subscribe-btn .icon::before {
    position: absolute;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: -1;
    content: '';
    width: 130px;
    height: 35px;
    border-radius: 30px;
    background-color: var(--header-subscribe-button-color, #cd201f);
}

.classic-subscribe-btn:hover .icon {
    transform: translateX(96px) translateY(-50%);
    transition: transform 0.5s;
}

.classic-subscribe-btn .text1 {
    font-size: 15px;
    font-weight: 600;
    margin-left: 22%;
    color: var(--header-subscribe-button-text-color, #cd201f);
    transition: color 0.3s;
}

.classic-subscribe-btn:hover .text1 {
    color: white;
}

.classic-subscribe-btn:hover .icon::before {
    background-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.classic-subscribe-btn:hover {
    border-color: var(--header-subscribe-button-hover-color, #b91c1c);
}

.classic-subscribe-btn .text2 {
    position: absolute;
    left: -60px;
    font-weight: 700;
    font-size: 14px;
    color: var(--header-subscribe-button-hover-text-color, #ffffff);
    transition: transform 0.6s;
}

.classic-subscribe-btn:hover .text2 {
    transform: translateX(100px);
    transition: transform 0.6s;
}

/* Mobile Responsive Styles - REMOVED DUPLICATES */

/* Force mobile layout with maximum specificity - REMOVED DUPLICATES */

/* Mobile styles for widget preview - REMOVED DUPLICATES */

/* Preview Responsive Styles for All Header Types - REMOVED DUPLICATES */

/* Video Grid Styles - Universal (works for both preview and embedded) */
.widget-preview .videos-grid,
.widget-preview-content .videos-grid,
.youtube-widget .videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
    padding-bottom: 15px;
}


/* Smooth slide transitions for video loading */
.widget-preview .videos-grid.slide-transition,
.widget-preview-content .videos-grid.slide-transition {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out;
}

.widget-preview .videos-grid.slide-in-right,
.widget-preview-content .videos-grid.slide-in-right {
    transform: translateX(100%);
}

.widget-preview .videos-grid.slide-in-left,
.widget-preview-content .videos-grid.slide-in-left {
    transform: translateX(-100%);
}

.widget-preview .videos-grid.slide-in-down,
.widget-preview-content .videos-grid.slide-in-down {
    transform: translateY(100%);
}

.widget-preview .videos-grid.slide-in-up,
.widget-preview-content .videos-grid.slide-in-up {
    transform: translateY(-100%);
}

.widget-preview .videos-grid.slide-out-right,
.widget-preview-content .videos-grid.slide-out-right {
    transform: translateX(100%);
}

.widget-preview .videos-grid.slide-out-left,
.widget-preview-content .videos-grid.slide-out-left {
    transform: translateX(-100%);
}

.widget-preview .videos-grid.slide-out-down,
.widget-preview-content .videos-grid.slide-out-down {
    transform: translateY(100%);
}

.widget-preview .videos-grid.slide-out-up,
.widget-preview-content .videos-grid.slide-out-up {
    transform: translateY(-100%);
}

/* Transition Effects */
.widget-preview .videos-grid.effect-slide,
.widget-preview-content .videos-grid.effect-slide {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out;
}

/* Slide effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-slide:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down),
.widget-preview-content .videos-grid.effect-slide:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    transform: translateX(0) translateY(0);
}

.widget-preview .videos-grid.effect-fade,
.widget-preview-content .videos-grid.effect-fade {
    transition: opacity var(--slide-transition-duration, 600ms) ease-in-out;
}

.widget-preview .videos-grid.effect-fade.slide-out-right,
.widget-preview .videos-grid.effect-fade.slide-out-left,
.widget-preview .videos-grid.effect-fade.slide-out-up,
.widget-preview .videos-grid.effect-fade.slide-out-down,
.widget-preview-content .videos-grid.effect-fade.slide-out-right,
.widget-preview-content .videos-grid.effect-fade.slide-out-left,
.widget-preview-content .videos-grid.effect-fade.slide-out-up,
.widget-preview-content .videos-grid.effect-fade.slide-out-down {
    opacity: 0;
}

.widget-preview .videos-grid.effect-fade.slide-in-right,
.widget-preview .videos-grid.effect-fade.slide-in-left,
.widget-preview .videos-grid.effect-fade.slide-in-up,
.widget-preview .videos-grid.effect-fade.slide-in-down,
.widget-preview-content .videos-grid.effect-fade.slide-in-right,
.widget-preview-content .videos-grid.effect-fade.slide-in-left,
.widget-preview-content .videos-grid.effect-fade.slide-in-up,
.widget-preview-content .videos-grid.effect-fade.slide-in-down {
    opacity: 0;
}

/* Fade effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-fade:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down),
.widget-preview-content .videos-grid.effect-fade:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    opacity: 1;
}

/* Scroll wrapper for slide effect */
.widget-preview .scroll-wrapper,
.widget-preview-content .scroll-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    will-change: transform;
    z-index: 10;
}

.widget-preview .scroll-item,
.widget-preview-content .scroll-item {
    flex-shrink: 0;
    position: relative;
}

.widget-preview .scroll-item-old,
.widget-preview-content .scroll-item-old,
.widget-preview .scroll-item-new,
.widget-preview-content .scroll-item-new {
    display: flex;
    align-items: stretch;
}

.widget-preview .videos-grid.effect-scale,
.widget-preview-content .videos-grid.effect-scale {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out, opacity var(--slide-transition-duration, 600ms) ease-in-out;
}

.widget-preview .videos-grid.effect-scale.slide-out-right,
.widget-preview .videos-grid.effect-scale.slide-out-left,
.widget-preview .videos-grid.effect-scale.slide-out-up,
.widget-preview .videos-grid.effect-scale.slide-out-down,
.widget-preview-content .videos-grid.effect-scale.slide-out-right,
.widget-preview-content .videos-grid.effect-scale.slide-out-left,
.widget-preview-content .videos-grid.effect-scale.slide-out-up,
.widget-preview-content .videos-grid.effect-scale.slide-out-down {
    transform: scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-scale.slide-in-right,
.widget-preview .videos-grid.effect-scale.slide-in-left,
.widget-preview .videos-grid.effect-scale.slide-in-up,
.widget-preview .videos-grid.effect-scale.slide-in-down,
.widget-preview-content .videos-grid.effect-scale.slide-in-right,
.widget-preview-content .videos-grid.effect-scale.slide-in-left,
.widget-preview-content .videos-grid.effect-scale.slide-in-up,
.widget-preview-content .videos-grid.effect-scale.slide-in-down {
    transform: scale(0.8);
    opacity: 0;
}

/* Scale effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-scale:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down),
.widget-preview-content .videos-grid.effect-scale:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    transform: scale(1);
    opacity: 1;
}

.widget-preview .videos-grid.effect-flip {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out;
}

.widget-preview .videos-grid.effect-flip.slide-out-right {
    transform: rotateY(90deg) translateX(100%);
}

.widget-preview .videos-grid.effect-flip.slide-out-left {
    transform: rotateY(-90deg) translateX(-100%);
}

.widget-preview .videos-grid.effect-flip.slide-out-up {
    transform: rotateX(90deg) translateY(-100%);
}

.widget-preview .videos-grid.effect-flip.slide-out-down {
    transform: rotateX(-90deg) translateY(100%);
}

.widget-preview .videos-grid.effect-flip.slide-in-right {
    transform: rotateY(-90deg) translateX(100%);
}

.widget-preview .videos-grid.effect-flip.slide-in-left {
    transform: rotateY(90deg) translateX(-100%);
}

.widget-preview .videos-grid.effect-flip.slide-in-up {
    transform: rotateX(-90deg) translateY(-100%);
}

.widget-preview .videos-grid.effect-flip.slide-in-down {
    transform: rotateX(90deg) translateY(100%);
}

/* Flip effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-flip:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    transform: rotateY(0deg) rotateX(0deg) translateX(0) translateY(0);
}

.widget-preview .videos-grid.effect-coverflow {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out, opacity var(--slide-transition-duration, 600ms) ease-in-out;
    transform-style: preserve-3d;
}

.widget-preview .videos-grid.effect-coverflow.slide-out-right {
    transform: rotateY(45deg) translateX(100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-out-left {
    transform: rotateY(-45deg) translateX(-100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-out-up {
    transform: rotateX(45deg) translateY(-100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-out-down {
    transform: rotateX(-45deg) translateY(100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-in-right {
    transform: rotateY(-45deg) translateX(100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-in-left {
    transform: rotateY(45deg) translateX(-100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-in-up {
    transform: rotateX(-45deg) translateY(-100%) scale(0.8);
    opacity: 0;
}

.widget-preview .videos-grid.effect-coverflow.slide-in-down {
    transform: rotateX(45deg) translateY(100%) scale(0.8);
    opacity: 0;
}

/* Coverflow effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-coverflow:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    transform: rotateY(0deg) rotateX(0deg) translateX(0) translateY(0) scale(1);
    opacity: 1;
}

.widget-preview .videos-grid.effect-cube {
    transition: transform var(--slide-transition-duration, 600ms) ease-in-out;
    transform-style: preserve-3d;
}

.widget-preview .videos-grid.effect-cube.slide-out-right {
    transform: rotateY(90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-out-left {
    transform: rotateY(-90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-out-up {
    transform: rotateX(90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-out-down {
    transform: rotateX(-90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-in-right {
    transform: rotateY(-90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-in-left {
    transform: rotateY(90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-in-up {
    transform: rotateX(-90deg) translateZ(-200px);
}

.widget-preview .videos-grid.effect-cube.slide-in-down {
    transform: rotateX(90deg) translateZ(-200px);
}

/* Cube effect - final state (when class is removed) */
.widget-preview .videos-grid.effect-cube:not(.slide-in-right):not(.slide-in-left):not(.slide-in-up):not(.slide-in-down):not(.slide-out-right):not(.slide-out-left):not(.slide-out-up):not(.slide-out-down) {
    transform: rotateY(0deg) rotateX(0deg) translateZ(0);
}


/* Preview mode grid columns - must override all other rules */
.widget-preview.preview-desktop .videos-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

.widget-preview.preview-tablet .videos-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.widget-preview.preview-mobile .videos-grid {
    grid-template-columns: 1fr !important;
}

/* Grid template specific styling */
.widget-preview [data-template="video-grid"] .videos-grid {
    grid-template-columns: repeat(4, 1fr);
}

.widget-preview [data-template="video-grid"].preview-desktop .videos-grid,
.widget-preview.preview-desktop [data-template="video-grid"] .videos-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

.widget-preview [data-template="video-grid"].preview-tablet .videos-grid,
.widget-preview.preview-tablet [data-template="video-grid"] .videos-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

.widget-preview [data-template="video-grid"].preview-mobile .videos-grid,
.widget-preview.preview-mobile [data-template="video-grid"] .videos-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Video Item Styles - Universal (works for both preview and embedded) */
.widget-preview .video-item,
.widget-preview-content .video-item,
.youtube-widget .video-item {
    background: var(--video-card-background-color, #ffffff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 7px var(--video-info-shadow-color, rgba(0, 0, 0, 0.2));
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.widget-preview .video-item:hover,
.widget-preview-content .video-item:hover,
.youtube-widget .video-item:hover {
    /* Zoom effect removed */
    box-shadow: 0 6px 12px var(--video-info-shadow-color, #000000);
}

/* Plain style - no shadow, no border radius */
.widget-preview .video-item.plain-style,
.widget-preview-content .video-item.plain-style,
.youtube-widget .video-item.plain-style {
    box-shadow: none !important;
    border-radius: 0 !important;
}

.widget-preview .video-item.plain-style:hover,
.widget-preview-content .video-item.plain-style:hover,
.youtube-widget .video-item.plain-style:hover {
    box-shadow: none !important;
}

.widget-preview .video-item.plain-style .video-thumbnail,
.widget-preview-content .video-item.plain-style .video-thumbnail,
.youtube-widget .video-item.plain-style .video-thumbnail {
    border-radius: 0 !important;
}

.widget-preview .video-item.plain-style .video-info,
.widget-preview-content .video-item.plain-style .video-info,
.youtube-widget .video-item.plain-style .video-info {
    padding: 12px 0 !important;
}

/* Single Video Template - Enhanced styling for single video display */
.widget-preview .videos-grid.single-video-template,
.widget-preview-content .videos-grid.single-video-template,
.youtube-widget .videos-grid.single-video-template {
    grid-template-columns: 1fr !important;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}

/* Center single video in widget preview */
.widget-preview .videos-section,
.widget-preview-content .videos-section,
.youtube-widget .videos-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Override max-width for single-video template to allow centering */
.widget-preview .videos-section:has(.videos-grid.single-video-template),
.widget-preview-content .videos-section:has(.videos-grid.single-video-template),
.youtube-widget .videos-section:has(.videos-grid.single-video-template) {
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.widget-preview .videos-section .videos-grid.single-video-template,
.widget-preview-content .videos-section .videos-grid.single-video-template,
.youtube-widget .videos-section .videos-grid.single-video-template {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
}

.widget-preview .single-video-item,
.widget-preview-content .single-video-item,
.youtube-widget .single-video-item {
    background: var(--video-card-background-color, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto !important;
    flex-shrink: 0;
}

.widget-preview .single-video-item:hover,
.widget-preview-content .single-video-item:hover,
.youtube-widget .single-video-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.widget-preview .single-video-thumbnail,
.widget-preview-content .single-video-thumbnail,
.youtube-widget .single-video-thumbnail {
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    overflow: hidden;
    background: #000;
}

.widget-preview .single-video-thumbnail img,
.widget-preview-content .single-video-thumbnail img,
.youtube-widget .single-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-preview .single-video-info,
.widget-preview-content .single-video-info,
.youtube-widget .single-video-info {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-preview .single-video-title,
.widget-preview-content .single-video-title,
.youtube-widget .single-video-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--video-title-color, #1f2937);
    margin: 0;
}

.widget-preview .single-video-channel,
.widget-preview-content .single-video-channel,
.youtube-widget .single-video-channel {
    font-size: 0.875rem;
    color: var(--video-channel-color, #6b7280);
    font-weight: 500;
    margin-top: 0.25rem;
}

.widget-preview .single-video-description,
.widget-preview-content .single-video-description,
.youtube-widget .single-video-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--video-description-color, #4b5563);
    margin: 0.5rem 0 0 0;
}

.widget-preview .single-video-metadata,
.widget-preview-content .single-video-metadata,
.youtube-widget .single-video-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--video-border-color, #e5e7eb);
    font-size: 0.875rem;
    color: var(--video-metadata-color, #6b7280);
}

/* Video Grid Template - Remove card styling (no background, no shadow, no border-radius) */
.widget-preview .videos-grid[data-template="video-grid"] .video-item,
.widget-preview-content .videos-grid[data-template="video-grid"] .video-item,
.youtube-widget .videos-grid[data-template="video-grid"] .video-item {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible;
}

.widget-preview .videos-grid[data-template="video-grid"] .video-item:hover,
.widget-preview-content .videos-grid[data-template="video-grid"] .video-item:hover,
.youtube-widget .videos-grid[data-template="video-grid"] .video-item:hover {
    box-shadow: none !important;
}

.widget-preview .videos-grid[data-template="video-grid"] .video-thumbnail,
.widget-preview-content .videos-grid[data-template="video-grid"] .video-thumbnail,
.youtube-widget .videos-grid[data-template="video-grid"] .video-thumbnail {
    border-radius: 15px !important;
    height: auto !important;
    aspect-ratio: 16/9 !important;
    padding-bottom: 0 !important;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16/9) {
    .widget-preview .videos-grid[data-template="video-grid"] .video-thumbnail,
    .widget-preview-content .videos-grid[data-template="video-grid"] .video-thumbnail,
    .youtube-widget .videos-grid[data-template="video-grid"] .video-thumbnail {
        height: 0 !important;
        padding-bottom: 56.25% !important;
    }
}

.widget-preview .video-thumbnail,
.widget-preview-content .video-thumbnail,
.youtube-widget .video-thumbnail {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    aspect-ratio: 16/9;
    min-height: 0;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16/9) {
    .widget-preview .video-thumbnail,
    .widget-preview-content .video-thumbnail,
    .youtube-widget .video-thumbnail {
        height: 0;
        padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    }
}

.widget-preview .video-thumbnail img,
.widget-preview-content .video-thumbnail img,
.youtube-widget .video-thumbnail img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-width: 100%;
    min-height: 100%;
    /* Transition removed since no transform effects */
}

.widget-preview .video-item:hover .video-thumbnail img,
.widget-preview-content .video-item:hover .video-thumbnail img,
.youtube-widget .video-item:hover .video-thumbnail img {
    /* Preserve centering transform on hover */
    transform: translate(-50%, -50%);
}


/* Video Duration */
.widget-preview .video-duration,
.widget-preview-content .video-duration,
.youtube-widget .video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.widget-preview .play-button,
.widget-preview-content .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Responsive play button sizing */
@media (max-width: 1024px) {
    .widget-preview .play-button,
    .widget-preview-content .play-button {
        width: 72px;
        height: 45px;
    }
}

@media (max-width: 768px) {
    .widget-preview .play-button,
    .widget-preview-content .play-button {
        width: 64px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .widget-preview .play-button,
    .widget-preview-content .play-button {
        width: 56px;
        height: 35px;
    }
}

.widget-preview .play-button svg,
.widget-preview-content .play-button svg {
    width: 100%;
    height: 100%;
}

/* Apply play button color and transparency */
.widget-preview .play-button svg .s1,
.widget-preview-content .play-button svg .s1 {
    fill: var(--play-button-color, #ff0000);
    opacity: var(--play-button-transparency, 1);
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.play-button svg {
    transition: transform 0.2s ease;
}

.play-button:hover svg {
    transform: scale(1.1);
    transform-origin: center;
}

.play-button:hover svg .s1 {
    fill: var(--play-button-hover-color, #cc0000);
    opacity: var(--play-button-hover-transparency, 1);
}

.widget-preview .play-button svg .s0,
.widget-preview-content .play-button svg .s0 {
    fill: var(--play-button-inner-color, #ffffff);
}

/* Video Info Styles - Universal (works for both preview and embedded) */
.widget-preview .video-info,
.widget-preview-content .video-info,
.youtube-widget .video-info {
    padding: 12px;
}

.widget-preview .video-title,
.widget-preview-content .video-title,
.youtube-widget .video-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--video-title-color, #111827);
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
    cursor: pointer;
}

.widget-preview .video-title:hover,
.widget-preview-content .video-title:hover,
.youtube-widget .video-title:hover {
    color: var(--video-title-hover-color, #374151);
    text-decoration: underline;
}

.widget-preview .video-description,
.widget-preview-content .video-description,
.youtube-widget .video-description {
    font-size: 13px;
    color: var(--video-description-color, #18191a);
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-preview .video-metadata,
.widget-preview-content .video-metadata,
.youtube-widget .video-metadata {
    font-size: 12px;
    color: var(--video-metadata-color, #6b7280);
    margin: 4px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.widget-preview .metadata-left {
    font-size: 12px;
    color: var(--video-metadata-color, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.widget-preview .metadata-right {
    font-size: 12px;
    color: var(--video-metadata-color, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Center metadata when it wraps to two lines on smaller screens */
@media (max-width: 600px) {
    .widget-preview .video-metadata,
    .widget-preview-content .video-metadata,
    .youtube-widget .video-metadata {
        justify-content: center;
        align-items: center;
    }
    
    .widget-preview .metadata-left,
    .widget-preview-content .metadata-left,
    .youtube-widget .metadata-left {
        text-align: center;
        width: 100%;
    }
    
    .widget-preview .metadata-right,
    .widget-preview-content .metadata-right,
    .youtube-widget .metadata-right {
        text-align: center;
        width: 100%;
    }
}

.widget-preview .video-info,
.widget-preview-content .video-info,
.youtube-widget .video-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Slide Navigation Styles */
.slide-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--slide-nav-background, transparent);
}

.slide-nav-btn {
    background: var(--slide-nav-button-bg, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--slide-nav-border, #e5e7eb);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--slide-nav-arrow, #333);
    box-shadow: 0 2px 4px var(--slide-nav-shadow, rgba(0, 0, 0, 0.1));
}

.slide-nav-btn:hover {
    background: var(--slide-nav-button-bg, rgba(255, 255, 255, 0.95));
    color: var(--slide-nav-arrow-hover, #111827);
    transform: scale(1.05);
}

.slide-nav-btn:disabled,
.slide-nav-btn.disabled {
    background: var(--slide-nav-button-bg, rgba(245, 245, 245, 0.5));
    cursor: not-allowed;
    opacity: 0.5;
}

.slide-nav-btn:disabled:hover,
.slide-nav-btn.disabled:hover {
    background: var(--slide-nav-button-bg, rgba(245, 245, 245, 0.5));
    transform: none;
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex: 1;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    color: var(--slide-nav-arrow, #9ca3af);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.page-number {
    min-width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--slide-nav-button-bg, rgba(255, 255, 255, 0.8));
    color: var(--pagination-text-color, #374151);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--slide-nav-border, #e5e7eb);
    padding: 5px 5px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: var(--pagination-hover-color, var(--slide-nav-arrow-hover, #374151));
    color: var(--pagination-text-color, var(--slide-nav-arrow-hover, #111827));
    transform: scale(1.1);
}

.page-number.active {
    background: var(--pagination-active-color, var(--pagination-hover-color, #d1d5db));
    color: var(--pagination-active-text-color, var(--pagination-text-color, #18191a));
}

.slide-nav-btn svg {
    color: var(--slide-nav-arrow, #374151);
    width: 20px;
    height: 20px;
}

.slide-nav-btn.loading {
    cursor: wait;
    pointer-events: none;
}

.button-loading-spinner {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-loading-spinner .spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid var(--slide-nav-arrow, #374151);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.button-loading-spinner .spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.button-loading-spinner .spinner-ring:nth-child(2) {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    border-top-color: rgba(55, 65, 81, 0.7);
    animation-delay: 0.15s;
}

.button-loading-spinner .spinner-ring:nth-child(3) {
    width: 12px;
    height: 12px;
    top: 6px;
    left: 6px;
    border-top-color: rgba(55, 65, 81, 0.5);
    animation-delay: 0.3s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Slide transition for videos grid */
.videos-grid {
    transition: transform 0.3s ease-in-out;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: var(--video-background-color, #ffffff);
}

/* Ensure videos grid container has proper overflow - Universal (works for both preview and embedded) */
.widget-preview .videos-section,
.widget-preview-content .videos-section,
.youtube-widget .videos-section {
    overflow: hidden;
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Video Search Bar */

/* Video Search Bar */
.video-search-bar {
    padding: 0.5rem 1rem;
    background: var(--search-bar-background-color, var(--header-color, #ffffff));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 500px;
    width: 100%;
}

.video-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--search-bar-icon-color, #9ca3af);
    pointer-events: none;
    z-index: 1;
    width: 16px;
    height: 16px;
}

.video-search-input {
    width: 100%;
    padding: 0.375rem 0.75rem 0.375rem 2.25rem;
    border: 1px solid var(--search-bar-border-color, #d1d5db);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: var(--search-bar-input-background-color, #ffffff);
    color: var(--search-bar-text-color, #374151);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.video-search-input:focus {
    outline: none;
    border-color: var(--search-bar-focus-border-color, #3b82f6);
    box-shadow: 0 0 0 3px var(--search-bar-focus-shadow-color, rgba(59, 130, 246, 0.1));
}

.video-search-input:focus + .video-search-clear,
.video-search-wrapper:hover .video-search-clear {
    opacity: 1;
}

.video-search-clear {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--search-bar-icon-color, #9ca3af);
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    z-index: 1;
}

.video-search-clear:hover {
    color: var(--search-bar-text-color, #374151);
    background: #f3f4f6;
    border-radius: 0.25rem;
}

.video-search-clear:active {
    background: #e5e7eb;
}

.video-search-results {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary-text-color, #6b7280);
    padding: 0.125rem 0;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

/* Highlight search terms */
.video-item mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Ensure videos grid has relative positioning for center navigation */
.videos-grid {
    position: relative;
}

/* Video Overlay Modal */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.video-overlay-content {
    position: relative;
    max-width: 854px;
    width: 100%;
    max-height: 90vh;
}

.video-overlay-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.video-overlay-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.video-overlay-iframe-container {
    aspect-ratio: 16/9;
    background: transparent;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 854px;
    height: 480px;
    max-width: 100%;
    max-height: 60vh;
}

.video-overlay-iframe {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    border: none;
}

/* Saved Widgets Page Layout Styles */
.saved-widgets-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    margin-top: 80px;
    min-height: calc(100vh - 120px);
    overflow-y: auto;
}

.saved-widgets-header {
    margin-bottom: 1.5rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #1d4ed8;
}

.back-btn .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.title-section h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.title-section p {
    color: #9ca3af;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-stats {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.stats-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-item .icon {
    width: 1rem;
    height: 1rem;
    color: #3b82f6;
}

.stat-item:last-child .icon {
    color: #10b981;
}

.bulk-delete-btn {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bulk-delete-btn:hover {
    background: #fee2e2;
}

.bulk-delete-btn .icon {
    width: 1rem;
    height: 1rem;
}

.filter-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-section {
    flex: 1;
    min-width: 300px;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-section {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #9ca3af;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background: #e5e7eb;
}

.clear-btn .icon {
    width: 1rem;
    height: 1rem;
}

/* View controls removed - only using list view */

.select-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    margin: 0;
}

.hidden {
    display: none !important;
}

.icon {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-bar {
        padding: 0.75rem !important;
        margin-bottom: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .controls-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .search-section {
        min-width: auto;
        width: 100%;
    }
    
    .filters-section {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-select {
        width: 100%;
        padding: 0.75rem 1rem !important;
    }
    
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .select-options {
        width: 100%;
        justify-content: center;
    }
    
    .search-input,
    #widget-search {
        padding: 0.75rem 1rem 0.75rem 2.5rem !important;
        font-size: 0.875rem;
    }
    
    #app {
        padding-top: 125px;
    }
    
}

/* Enhanced Saved Widgets Page Styles */

/* Widget Stats */
#widget-stats {
    animation: fadeIn 0.3s ease;
}

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

/* Grid widget cards removed - only using list view */

/* List View Styles */
.saved-widgets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-widget-list-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.saved-widget-list-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.widget-list-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

.widget-list-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.widget-preview-small {
    width: 80px;
    height: 50px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.widget-list-info {
    flex: 1;
    min-width: 0;
}

.widget-list-info .widget-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.widget-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.template-tag {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    color: white;
}

.template-tag.video-grid {
    background: #8b5cf6;
}

.template-tag.youtube-channel {
    background: #ef4444;
}

.channel-name {
    font-size: 14px;
    color: #9ca3af;
}

.widget-dates {
    font-size: 12px;
    color: #9ca3af;
}

.widget-list-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.widget-list-actions .widget-action-btn {
    flex: none;
    min-width: auto;
    padding: 6px 10px;
}

/* Grid view removed - only using list view */

/* Empty State Styling */
.saved-widgets-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.saved-widgets-empty h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.saved-widgets-empty p {
    font-size: 14px;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .saved-widgets-container {
        padding: 0.5rem;
        margin-top: 150px;
    }
    
    .saved-widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .widget-preview-thumbnail {
        height: 100px;
    }
    
    .preview-container {
        padding: 8px;
    }
    
    .widget-list-content {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .widget-list-left {
        gap: 12px;
    }
    
    .widget-list-actions {
        justify-content: space-between;
        gap: 6px;
    }
    
    .widget-list-actions .widget-action-btn {
        flex: 1;
        padding: 8px 6px;
        font-size: 11px;
    }
}

/* Removed .video-overlay-info empty ruleset */

.video-overlay-info-title {
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.video-overlay-description {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.video-overlay-metadata {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Save Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002; /* Higher than fullscreen (1001) and auth modal (10000) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid #e5e7eb;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* Save Modal Specific Styles */
.save-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.05);
    padding: 2.5rem;
    animation: modalSlideIn 0.3s ease-out;
}

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

.save-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.save-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
    }
}

.save-modal-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.save-modal-subtitle {
    font-size: 0.9375rem;
    color: #9ca3af;
    margin: 0;
    font-weight: 400;
}

.save-form-group {
    margin-bottom: 2rem;
}

.save-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
}

.input-wrapper {
    position: relative;
}

.save-input {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.save-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.save-input::placeholder {
    color: #9ca3af;
}

.save-help-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.8125rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.save-help-text i {
    color: #fbbf24;
    font-size: 0.875rem;
}

.save-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.save-modal-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.save-modal-actions .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.save-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border: none;
}

.save-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.save-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.save-btn-primary i {
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    width: 100%;
}

.modal-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-width: 120px;
    flex: 0 0 auto;
}

.modal-actions .btn-primary {
    background: #2563eb;
    color: white;
}

.modal-actions .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.modal-actions .btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    color: #111827;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[type="text"]::placeholder {
    color: #9ca3af;
}





/* Loading and error states for slides */
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    max-height: 100%;
    padding: 2rem;
    color: #9ca3af;
    font-size: 0.875rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.videos-grid:has(.loading-more) {
    position: relative;
    min-height: 200px;
    max-height: fit-content;
}

.loading-more .loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

.loading-more .loading-spinner .spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary-color, #ff0000);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loading-more .loading-spinner .spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.loading-more .loading-spinner .spinner-ring:nth-child(2) {
    width: 45px;
    height: 45px;
    top: 7.5px;
    left: 7.5px;
    border-top-color: rgba(255, 0, 0, 0.7);
    animation-delay: 0.2s;
}

.loading-more .loading-spinner .spinner-ring:nth-child(3) {
    width: 30px;
    height: 30px;
    top: 15px;
    left: 15px;
    border-top-color: rgba(255, 0, 0, 0.5);
    animation-delay: 0.4s;
}

.loading-more .loading-text {
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
}

.no-videos {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
}

.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
}

.error h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.error p {
    margin: 0.25rem 0;
    color: #9ca3af;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    color: var(--slide-nav-arrow, #9ca3af);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

/* Pagination positioning for different templates */
.slide-navigation-sides {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    justify-content: space-between;
    padding: 0 1rem;
}

/* ===== MODERN WIDGETS PAGE REDESIGN ===== */

/* Override old styles */
.saved-widgets-page,
.widgets-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    overflow-y: auto;
    padding: 0;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 80px;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 80px);
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Back button removed */

.page-title h1,
.title-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.25rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title p,
.title-section p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.875rem;
    text-align: center;
}

.header-actions .action-btn,
#bulk-actions-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background: rgba(239, 68, 68, 0.8) !important;
    border: 2px solid rgba(239, 68, 68, 0.9) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}

.action-btn.danger:hover,
#bulk-actions-btn:hover {
    background: rgba(239, 68, 68, 0.95) !important;
    border-color: #ef4444 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

.header-actions .action-btn svg,
#bulk-actions-btn svg {
    width: 18px;
    height: 18px;
}



/* Controls */
.page-controls,
.filter-bar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-radius: 16px !important;
    padding: 1.5rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.search-container,
.search-section {
    flex: 1;
    min-width: 300px;
}

.search-box,
.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 20px;
    height: 20px;
}

.search-input,
#widget-search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 0.875rem;
    background: white !important;
    transition: all 0.3s ease;
}

.search-input:focus,
#widget-search:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

.filters-container,
.filters-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select,
#template-filter,
#sort-filter {
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    font-size: 0.875rem;
    background: white !important;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    background-position: right 1rem center !important;
    background-repeat: no-repeat !important;
}

.filter-select:focus,
#template-filter:focus,
#sort-filter:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

.select-all-checkbox,
.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.select-all-checkbox input[type="checkbox"],
.select-all-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

/* View Controls */
.view-controls {
    margin-top: 0;
    margin-bottom: 0;
    flex-shrink: 0;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
    border: 1px solid #e5e7eb;
    width: fit-content;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.view-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-btn svg {
    flex-shrink: 0;
}

/* Content */
.page-content,
#saved-widgets-content {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    min-height: 400px;
    padding: 2rem !important;
}

/* Widget Cards - Modern Design */
.saved-widgets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 0;
}

.saved-widget-grid-item {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb !important;
    overflow: hidden;
}

.saved-widget-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
    border-color: #3b82f6 !important;
}

.widget-grid-content {
    padding: 1rem;
}

.widget-grid-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
}

.widget-grid-top-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.75rem;
    z-index: 2;
}

.widget-grid-top-controls .template-tag {
    margin: 0;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

.widget-grid-top-controls .widget-delete-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

/* Removed hover color change - button stays consistent */

/* Widget Name Edit Styles */
.widget-name-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.widget-name-edit h3 {
    margin: 0;
}

.edit-name-btn {
    background: transparent;
    color: #9ca3af;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Removed hover opacity rule - button is now always visible */

.edit-name-btn:hover {
    color: #10b981;
}

.edit-name-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.widget-name-input {
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.widget-name-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.widget-delete-btn {
    background: transparent;
    color: #9ca3af;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-delete-btn:hover {
    color: #dc2626;
}

.widget-delete-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
    color: inherit;
    stroke: currentColor;
}

.widget-grid-checkbox {
    margin-right: 1rem;
    margin-top: 0.25rem;
    z-index: 1;
}

.widget-grid-preview {
    width: 100%;
    height: 200px;
    background: #374151;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-grid-preview .template-preview-frame {
    width: 100% !important;
    height: 100% !important;
    max-height: 140px !important;
    border: none !important;
    padding: 0.75rem !important;
    background: #1f2937 !important;
    display: flex !important;
    flex-direction: column !important;
}

.widget-grid-preview .template-content-preview {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.widget-grid-preview .video-grid-preview {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.25rem !important;
    height: 100% !important;
    width: 100% !important;
}

.widget-grid-preview .video-grid-item {
    background: #4b5563 !important;
    border: 1px solid #6b7280 !important;
    border-radius: 0.25rem !important;
    min-height: 1rem !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.widget-grid-preview .video-grid-item::before {
    content: '' !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid #dc2626 !important;
    border-top: 3px solid transparent !important;
    border-bottom: 3px solid transparent !important;
    opacity: 0.7 !important;
}

.widget-grid-preview .channel-banner {
    height: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

.widget-grid-preview .channel-header {
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.widget-grid-preview .channel-avatar {
    width: 1rem !important;
    height: 1rem !important;
}

.widget-grid-preview .content-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.25rem !important;
    flex: 1 !important;
}

.widget-grid-preview .video-preview-item {
    background: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 0.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 1.5rem !important;
}

.widget-grid-info h3 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 0.75rem 0 !important;
    line-height: 1.4;
}

.widget-grid-details {
    margin-bottom: 0.75rem;
}

.widget-grid-details .template-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #3b82f6;
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.widget-grid-details .template-tag.video-grid {
    background: #8b5cf6 !important;
}

.widget-grid-details .channel-name {
    display: block;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.widget-grid-dates {
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.widget-grid-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.widget-grid-actions .widget-action-btn {
    flex: 1;
    min-width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    justify-content: center;
}

.saved-widget-list-item {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb !important;
}

.saved-widget-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    border-color: #3b82f6 !important;
}

.widget-list-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.widget-list-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.widget-preview-small {
    width: 100px !important;
    height: 80px !important;
    background: #374151 !important;
    border-radius: 8px !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    padding: 0.25rem;
}

.widget-preview-small .template-preview-frame {
    height: 100% !important;
    border: none !important;
    padding: 0.25rem !important;
    background: #1f2937 !important;
}

.widget-preview-small .template-content-preview {
    gap: 0.25rem !important;
}

.widget-preview-small .channel-banner {
    height: 0.75rem !important;
}

.widget-preview-small .channel-header {
    gap: 0.25rem !important;
}

.widget-preview-small .channel-avatar {
    width: 0.5rem !important;
    height: 0.5rem !important;
}

.widget-preview-small .channel-avatar svg {
    width: 0.375rem !important;
    height: 0.375rem !important;
}

.widget-preview-small .channel-title-line {
    width: 1rem !important;
    height: 0.125rem !important;
    margin-bottom: 0.125rem !important;
}

.widget-preview-small .channel-subtitle-line {
    width: 0.75rem !important;
    height: 0.125rem !important;
}

.widget-preview-small .content-grid-3 {
    gap: 0.125rem !important;
}

.widget-preview-small .single-video-preview {
    height: 100% !important;
    width: 100% !important;
}

.widget-preview-small .single-video-thumbnail {
    height: 100% !important;
    padding-bottom: 0 !important;
}

.widget-preview-small .play-button-center {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.widget-preview-small .play-button-center svg {
    width: 0.5rem !important;
    height: 0.5rem !important;
    margin-left: 1px !important;
}

.widget-preview-small .video-preview-item {
    border: none !important;
}


.widget-preview-small .video-info {
    padding: 0.125rem !important;
}

.widget-preview-small .video-title-line {
    width: 100% !important;
    height: 0.0625rem !important;
    margin-bottom: 0.0625rem !important;
}

.widget-preview-small .video-meta-line {
    width: 70% !important;
    height: 0.0625rem !important;
}

.widget-preview-small .video-grid-preview {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.125rem !important;
    height: 100% !important;
}

.widget-preview-small .video-grid-item {
    background: #4b5563 !important;
    border: 1px solid #6b7280 !important;
    border-radius: 0.125rem !important;
    min-height: 0.5rem !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.widget-preview-small .video-grid-item::before {
    content: '' !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 3px solid #dc2626 !important;
    border-top: 2px solid transparent !important;
    border-bottom: 2px solid transparent !important;
    opacity: 0.7 !important;
}

.widget-list-info {
    flex: 1;
}

.widget-details h3 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 0.5rem 0 !important;
}

.template-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #3b82f6;
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.template-tag.video-grid {
    background: #8b5cf6 !important;
}

.template-tag.youtube-channel {
    background: #ef4444 !important;
}

.channel-name {
    color: #6b7280 !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.25rem;
}

.widget-dates {
    font-size: 0.75rem !important;
    color: #9ca3af !important;
}

.widget-list-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-list-actions input[type="checkbox"] {
    transform: scale(1.2);
}

.widget-action-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.widget-action-btn.primary {
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
}

.widget-action-btn.primary:hover {
    background: #2563eb !important;
}

.widget-action-btn.secondary {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
}

.widget-action-btn.secondary:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.widget-action-btn.danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
}

.widget-action-btn.danger:hover {
    background: #fecaca !important;
    color: #991b1b !important;
    border-color: #f87171 !important;
}

.widget-action-btn.danger svg {
    width: 16px !important;
    height: 16px !important;
}

.widget-action-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

.delete-widget-btn {
    padding: 0.5rem !important;
    background: transparent !important;
    border: none !important;
    color: #ef4444 !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-widget-btn:hover {
    background: #fee2e2 !important;
}

/* Beautiful Empty State */
.saved-widgets-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 4rem 2rem !important;
    min-height: 500px !important;
    background: transparent !important;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state-content h2 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
}

.empty-state-content p {
    font-size: 1.125rem !important;
    color: #6b7280 !important;
    margin-bottom: 2rem !important;
    max-width: 500px !important;
    line-height: 1.6 !important;
}

.create-widget-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem 2rem !important;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
    text-decoration: none !important;
}

.create-widget-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4) !important;
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
}

.create-widget-btn svg {
    transition: transform 0.3s ease !important;
}

.create-widget-btn:hover svg {
    transform: rotate(90deg) !important;
}

/* Responsive Empty State */
@media (max-width: 768px) {
    .saved-widgets-empty {
        padding: 2rem 1rem !important;
        min-height: 400px !important;
    }
    
    .empty-state-illustration svg {
        width: 150px !important;
        height: 120px !important;
    }
    
    .empty-state-content h2 {
        font-size: 1.5rem !important;
    }
    
    .empty-state-content p {
        font-size: 1rem !important;
    }
    
    .create-widget-btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* Responsive Grid */
@media (max-width: 768px) {
    .saved-widgets-grid {
        grid-template-columns: 1fr !important;
    }
    
    .view-toggle {
        flex-direction: column;
        gap: 0.5rem;
        width: auto;
    }
    
    .view-btn {
        justify-content: center;
    }

}

@media (max-width: 480px) {
    .widget-grid-actions {
        flex-direction: column;
    }
    .header-right {
        justify-content: center;
    }
    
    .widget-grid-actions .widget-action-btn {
        flex: none;
    }
    
    .widget-name-edit {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.25rem;
        display: flex;
    }
    
    .edit-name-btn {
        opacity: 1;
        align-self: flex-end;
    }

    .page-content, #saved-widgets-content {
        padding: 1rem !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem !important;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-content {
        justify-content: center;
    }
    
    .page-controls,
    .filter-bar {
        padding: 0.75rem !important;
        margin-bottom: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .controls-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .search-container,
    .search-section {
        min-width: auto;
        width: 100%;
    }
    
    .filters-container,
    .filters-section {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        justify-content: stretch;
    }
    
    .filter-select,
    #template-filter,
    #sort-filter {
        width: 100%;
        min-width: auto !important;
        padding: 0.75rem 1rem !important;
    }
    
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .select-options {
        width: 100%;
        justify-content: center;
    }
    
    .search-input,
    #widget-search {
        padding: 0.75rem 1rem 0.75rem 2.5rem !important;
        font-size: 0.875rem;
    }
    
    .widget-list-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .widget-list-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .widget-list-actions {
        justify-content: center;
    }
}

/* Responsive Design for Headers */
@media (max-width: 1024px) {
    /* Tablet Styles */
    .accent-header {
        height: 280px;
    }
    
    .accent-content {
        padding: 1.5rem;
    }
    
    .accent-logo {
        width: 110px;
        height: 110px;
    }
    
    .accent-channel-name {
        font-size: 1.4rem;
    }
    
    .accent-channel-description {
        font-size: 0.8rem;
        max-width: 500px;
    }
    
    .accent-stats {
        font-size: 0.9rem;
    }
    
    .minimal-banner {
        height: 200px;
    }
    
    .minimal-subheader {
        top: 20%;
        padding: 1rem 1.5rem;
    }
    
    .minimal-logo-container {
        width: 70px;
        height: 70px;
    }
    
    .minimal-channel-name {
        font-size: 1.3rem;
    }
    
    .classic-banner {
        height: 180px;
    }
    
    .classic-subheader {
        padding: 1rem 1.5rem;
    }
    
    .classic-content {
        padding: 0 1.5rem;
    }
    
    .classic-header-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .classic-header-row .classic-profile-image {
        flex-shrink: 0;
    }
    
    .classic-header-row .classic-channel-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .classic-header-row .classic-subscribe-section {
        flex-shrink: 0;
    }
    
    .classic-profile-image {
        width: 70px;
        height: 70px;
    }
    
    .classic-channel-name {
        font-size: 1.3rem;
    }
    
    /* Play button hover effect for tablet */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

@media (max-width: 768px) {
    /* Mobile Styles */
    .accent-header {
        height: 250px;
    }
    
    .accent-content {
        padding: 1rem;
    }
    
    .accent-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .accent-channel-name {
        font-size: 1.3rem;
        margin: 0 0 0.5rem 0;
    }
    
    .accent-channel-description {
        font-size: 0.8rem;
        max-width: 400px;
        margin: 0 0 0.5rem 0;
    }
    
    .accent-stats {
        font-size: 0.9rem;
        margin: 0 0 0.5rem 0;
    }
    
    .accent-subscribe-btn {
        width: 120px;
        height: 32px;
    }
    
    .accent-subscribe-btn .text1 {
        font-size: 14px;
    }
    
    .accent-subscribe-btn .text2 {
        font-size: 13px;
    }
    
    .minimal-header {
        margin-bottom: 0.75rem;
    }
    
    .minimal-banner {
        height: 180px;
    }
    
    .minimal-subheader {
        top: 25%;
        padding: 0.75rem 1rem;
    }
    
    .minimal-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .minimal-left {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        margin-top: 0.5rem !important;
    }
    
    .minimal-logo-container {
        width: 70px;
        height: 70px;
    }
    
    .minimal-channel-name {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .minimal-channel-description {
        font-size: 0.8rem;
        text-align: center;
        max-width: 250px;
    }
    
    .minimal-stats {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .minimal-right {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .minimal-subscribe-section {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .minimal-subscribe-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    
    .classic-header {
        margin-bottom: 0.75rem;
    }
    
    .classic-banner {
        height: 160px;
    }
    
    .classic-subheader {
        padding: 0.75rem 1rem;
    }
    
    .classic-content {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }
    
    .classic-left {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .classic-profile-image {
        width: 70px;
        height: 70px;
    }
    
    .classic-channel-name {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .classic-channel-description {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .classic-stats {
        font-size: 0.9rem;
        text-align: center;
        white-space: normal !important;
        overflow: visible !important;
        word-break: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        display: block !important;
        width: 100% !important;
        line-height: 1.4 !important;
        margin: 0.5rem 0 !important;
    }
    
    .classic-right {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .classic-subscribe-btn {
        width: 120px;
        height: 32px;
    }
    
    .classic-subscribe-btn .text1 {
        font-size: 14px;
    }
    
    .classic-subscribe-btn .text2 {
        font-size: 13px;
    }
    
    /* Play button hover effect for mobile */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

@media (max-width: 480px) {
    /* Small Mobile Styles */
    .accent-header {
        height: 280px;
    }
    
    .accent-content {
        padding: 0.75rem;
    }
    
    .accent-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 0.75rem;
    }
    
    .accent-channel-name {
        font-size: 1.1rem;
        margin: 0 0 0.4rem 0;
    }
    
    .accent-channel-description {
        font-size: 0.75rem;
        max-width: 250px;
        margin: 0 0 0.4rem 0;
    }
    
    .accent-stats {
        font-size: 0.8rem;
        margin: 0 0 0.4rem 0;
    }
    
    .accent-subscribe-btn {
        width: 110px;
        height: 30px;
    }
    
    .accent-subscribe-btn .text1 {
        font-size: 13px;
    }
    
    .accent-subscribe-btn .text2 {
        font-size: 12px;
    }
    
    .minimal-banner {
        height: 160px;
    }
    
    .minimal-subheader {
        top: 30%;
        padding: 0.5rem 0.75rem;
    }
    
    .minimal-content {
        gap: 0.75rem;
    }
    
    .minimal-left {
        gap: 0.5rem;
    }
    
    .minimal-logo-container {
        width: 60px;
        height: 60px;
    }
    
    .minimal-channel-name {
        font-size: 1.1rem;
    }
    
    .minimal-channel-description {
        font-size: 0.75rem;
        max-width: 200px;
    }
    
    .minimal-stats {
        font-size: 0.8rem;
    }
    
    .minimal-subscribe-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    .classic-banner {
        height: 140px;
    }
    
    .classic-subheader {
        padding: 0.5rem 0.75rem;
    }
    
    .classic-content {
        gap: 0.75rem !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .classic-header-row {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .classic-profile-image {
        margin: 0 auto !important;
        display: block !important;
    }
    
    .classic-channel-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .classic-subscribe-section {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    .classic-profile-image {
        width: 60px;
        height: 60px;
    }
    
    .classic-channel-name {
        font-size: 1.1rem;
    }
    
    .classic-channel-description {
        font-size: 0.75rem;
    }
    
    .classic-stats {
        font-size: 0.8rem;
    }
    
    .classic-subscribe-btn {
        width: 110px;
        height: 30px;
    }
    
    .classic-subscribe-btn .text1 {
        font-size: 13px;
    }
    
    .classic-subscribe-btn .text2 {
        font-size: 12px;
    }
    
    /* Channel name link mobile styles */
    .channel-name-link {
        font-size: 1.1rem !important;
    }
    
    /* Play button hover effect for small mobile */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

@media (max-width: 360px) {
    /* Extra Small Mobile Styles */
    .accent-header {
        height: 180px;
    }
    
    .accent-content {
        padding: 0.5rem;
    }
    
    .accent-logo {
        width: 70px;
        height: 70px;
        margin-bottom: 0.5rem;
    }
    
    .accent-channel-name {
        font-size: 1rem;
    }
    
    .accent-channel-description {
        font-size: 0.7rem;
        max-width: 200px;
    }
    
    .accent-stats {
        font-size: 0.75rem;
    }
    
    .accent-subscribe-btn {
        width: 100px;
        height: 28px;
    }
    
    .accent-subscribe-btn .text1 {
        font-size: 12px;
    }
    
    .accent-subscribe-btn .text2 {
        font-size: 11px;
    }
    
    .minimal-banner {
        height: 140px;
    }
    
    .minimal-logo-container {
        width: 50px;
        height: 50px;
    }
    
    .minimal-channel-name {
        font-size: 1rem;
    }
    
    .minimal-channel-description {
        font-size: 0.7rem;
        max-width: 180px;
    }
    
    .minimal-stats {
        font-size: 0.75rem;
    }
    
    .classic-banner {
        height: 120px;
    }
    
    .classic-profile-image {
        width: 50px;
        height: 50px;
    }
    
    .classic-channel-name {
        font-size: 1rem;
    }
    
    .classic-channel-description {
        font-size: 0.7rem;
    }
    
    .classic-stats {
        font-size: 0.75rem;
    }
    
    .classic-subscribe-btn {
        width: 100px;
        height: 28px;
    }
    
    .classic-subscribe-btn .text1 {
        font-size: 12px;
    }
    
    .classic-subscribe-btn .text2 {
        font-size: 11px;
    }
    
    /* Play button hover effect for extra small mobile */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

/* Video Grid Responsive Design */
@media (max-width: 1024px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    /* Play button hover effect for tablet */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    /* Play button hover effect for mobile */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Play button hover effect for small mobile */
    .play-button:hover svg {
        transform: scale(1.1);
        transform-origin: center;
    }
}

/* Slider Styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.slider::-webkit-slider-track {
    background: #374151;
    height: 8px;
    border-radius: 4px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.slider::-moz-range-track {
    background: #374151;
    height: 8px;
    border-radius: 4px;
    border: none;
}

.slider::-moz-range-thumb {
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Font Size Input Styling */
#font-size-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

#font-size-input::-webkit-outer-spin-button,
#font-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#font-size-preview {
    display: inline-block;
    color: #60a5fa;
    font-weight: 600;
    transition: font-size 0.2s ease;
    line-height: 1.2;
}

/* CLEAN MOBILE PREVIEW - COLUMN LAYOUT */
.widget-content.preview-mobile .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-subscribe-section {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

/* MINIMAL HEADER MOBILE PREVIEW */
.widget-preview.preview-mobile .minimal-banner {
    height: 290px !important;
}

.widget-preview.preview-mobile .minimal-banner-image,
.widget-content.preview-mobile .minimal-banner-image {
    background-size: 150% !important;
    background-position: center !important;
}

.widget-preview.preview-mobile .accent-banner-background,
.widget-content.preview-mobile .accent-banner-background {
    background-position: center !important;
}

.widget-preview.preview-mobile .classic-banner-image,
.widget-content.preview-mobile .classic-banner-image {
    background-size: 200% !important;
    background-position: center !important;
}

.widget-preview.preview-mobile .minimal-subheader {
    top: 2px !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    height: 290px !important;
    padding: 1rem !important;
    padding-top: 2rem !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content .minimal-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content .minimal-left .minimal-profile-image {
    margin: 0 auto !important;
    display: block !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content .minimal-left .minimal-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content .minimal-right {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
}

.widget-content.preview-mobile .minimal-banner {
    height: 290px !important;
}

.widget-content.preview-mobile .minimal-banner-image {
    background-size: 150% !important;
    background-position: center !important;
}

.widget-content.preview-mobile .accent-banner-background {
    background-size: 150% !important;
    background-position: center !important;
}

.widget-content.preview-mobile .classic-banner-image {
    background-size: 150% !important;
    background-position: center !important;
}

.widget-content.preview-mobile .minimal-subheader {
    top: 2px !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    height: 290px !important;
    padding: 1rem !important;
    padding-top: 2rem !important;
}

.widget-content.preview-mobile .minimal-subheader .minimal-content .minimal-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .minimal-subheader .minimal-content .minimal-left .minimal-profile-image {
    margin: 0 auto !important;
    display: block !important;
}

.widget-content.preview-mobile .minimal-subheader .minimal-content .minimal-left .minimal-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .minimal-subheader .minimal-content .minimal-right {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* TABLET PREVIEW MODE - MINIMAL HEADER */
.widget-preview.preview-tablet .minimal-banner {
    height: 190px !important;
}

.widget-preview.preview-tablet .minimal-subheader {
    top: 2px !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    height: 190px !important;
}

.widget-preview.preview-tablet .minimal-subheader .minimal-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* ACCENT HEADER MOBILE PREVIEW */
.widget-content.preview-mobile .accent-subheader .accent-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .accent-subheader .accent-content .accent-logo-container {
    margin: 0 auto !important;
    display: block !important;
}

.widget-content.preview-mobile .accent-subheader .accent-content .accent-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .accent-subheader .accent-content .accent-subscribe-section {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* ACTUAL MOBILE DEVICES - COLUMN AND CENTERED */
@media (max-width: 768px) {
    .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .minimal-subheader .minimal-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        width: 100% !important;
    }
    
    .minimal-subheader .minimal-content .minimal-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .minimal-subheader .minimal-content .minimal-right {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    .accent-subheader .accent-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        width: 100% !important;
    }
    
    .accent-subheader .accent-content .accent-logo-container {
        margin: 0 auto !important;
        display: block !important;
    }
    
    .accent-subheader .accent-content .accent-channel-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .accent-subheader .accent-content .accent-subscribe-section {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
}

.classic-header-row .classic-profile-image {
    margin: 0 auto !important;
    display: block !important;
}

.classic-header-row .classic-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.classic-header-row .classic-channel-info .classic-channel-name,
.classic-header-row .classic-channel-info .classic-channel-description,
.classic-header-row .classic-channel-info .classic-stats {
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
}

.classic-header-row .classic-subscribe-section {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* MOBILE LAYOUT - COLUMN AND CENTERED */
@media (max-width: 768px) {
    /* For widget.js structure (.classic-left, .classic-right) */
    .classic-subheader .classic-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        width: 100% !important;
    }
    
    .classic-subheader .classic-content .classic-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .classic-subheader .classic-content .classic-left .classic-profile-image {
        margin: 0 auto !important;
        display: block !important;
    }
    
    .classic-subheader .classic-content .classic-left .classic-channel-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .classic-subheader .classic-content .classic-left .classic-channel-info .classic-channel-name,
    .classic-subheader .classic-content .classic-left .classic-channel-info .classic-channel-description,
    .classic-subheader .classic-content .classic-left .classic-channel-info .classic-stats {
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .classic-subheader .classic-content .classic-right {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    /* For app.js structure (.classic-header-row) */
    .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .classic-subheader .classic-content .classic-header-row .classic-profile-image {
        margin: 0 auto !important;
        display: block !important;
    }
    
    .classic-subheader .classic-content .classic-header-row .classic-channel-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name,
    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description,
    .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats {
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .classic-subheader .classic-content .classic-header-row .classic-subscribe-section {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }
}

/* MOBILE PREVIEW MODE - COLUMN AND CENTERED */
.widget-content.preview-mobile .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-left .classic-profile-image {
    margin: 0 auto !important;
    display: block !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-left .classic-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-left .classic-channel-info .classic-channel-name,
.widget-content.preview-mobile .classic-subheader .classic-content .classic-left .classic-channel-info .classic-channel-description,
.widget-content.preview-mobile .classic-subheader .classic-content .classic-left .classic-channel-info .classic-stats {
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
}

.widget-content.preview-mobile .classic-subheader .classic-content .classic-right {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* CORRECT SOLUTION - BASED ON ACTUAL HTML STRUCTURE */

/* DESKTOP PREVIEW - ROW LAYOUT (Logo - Channel Info - Subscribe) */
.widget-content.preview-desktop .classic-subheader .classic-content,
.widget-preview-content .classic-subheader .classic-content,
.youtube-widget .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
}

.widget-content.preview-desktop .classic-subheader .classic-content .classic-header-row,
.widget-preview-content .classic-subheader .classic-content .classic-header-row,
.youtube-widget .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

/* MOBILE PREVIEW - COLUMN LAYOUT (Everything centered) */
.widget-content.preview-mobile     /* REMOVED - This was conflicting with preview-specific rules */

.widget-content.preview-mobile .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

/* ACTUAL WIDGET - DESKTOP ROW LAYOUT (Logo - Channel Info - Subscribe) */
@media (min-width: 769px) {
    /* Embedded widget - desktop layout */
    .widget-preview-content .classic-subheader .classic-content,
    .youtube-widget .classic-subheader .classic-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        max-width: 1200px !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 1rem !important;
    }
    
    .widget-preview-content .classic-subheader .classic-content .classic-header-row,
    .youtube-widget .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        flex: 1 !important;
    }
    
    .widget-preview-content .classic-subheader .classic-content .classic-subscribe-section,
    .youtube-widget .classic-subheader .classic-content .classic-subscribe-section {
        flex-shrink: 0 !important;
    }
    
    /* Legacy support */
    .classic-subheader .classic-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        max-width: 1200px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        flex: 1 !important;
    }
    
    .classic-subheader .classic-content .classic-subscribe-section {
        flex-shrink: 0 !important;
    }
    
    .classic-subheader .classic-content .classic-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        flex: 1 !important;
    }
}

/* ACTUAL WIDGET - MOBILE COLUMN LAYOUT (Everything centered) */
@media (max-width: 768px) {
    /* REMOVED - This was conflicting with preview-specific rules */
    
    .classic-subheader .classic-content .classic-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
}

/* FINAL WORKING SOLUTION */
.widget-preview.preview-desktop .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
}

.widget-preview.preview-desktop .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

.widget-preview.preview-mobile .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
}

.widget-preview.preview-mobile .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .classic-subheader .classic-content .classic-header-row .classic-channel-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.widget-preview.preview-mobile .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description {
    text-align: center !important;
}

.widget-preview.preview-mobile .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats {
    text-align: center !important;
}

.widget-preview.preview-tablet .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
}

.widget-preview.preview-tablet .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
}

/* Authentication Styles */
.user-account {
    position: relative;
    display: flex;
    align-items: center;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: #2563eb;
}

.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 2rem;
}

.user-avatar-btn:hover {
    color: #3b82f6;
    background: #f3f4f6;
}

.user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.05);
    min-width: 220px;
    z-index: 1000;
    animation: menuSlideIn 0.2s ease-out;
    overflow: hidden;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #111827;
    font-weight: 600;
    width: 100%;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
}

.user-info i {
    font-size: 1.5rem;
    color: #3b82f6;
    opacity: 0.8;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
}

.user-menu-item:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    color: #3b82f6;
    transform: translateX(2px);
}

.user-menu-item i {
    width: 18px;
    text-align: center;
    transition: all 0.2s ease;
}

.user-menu-item:hover i {
    color: #3b82f6;
    transform: scale(1.1);
}

/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Wider modal for registration form */
#auth-modal .auth-modal-content.register-form-active {
    max-width: 800px !important;
    width: 90% !important;
    min-width: 600px !important;
}

/* Also target when style attribute is set */
#auth-modal .auth-modal-content[style*="max-width: 800px"] {
    max-width: 800px !important;
    width: 90% !important;
    min-width: 600px !important;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.auth-modal-logo {
    width: 32px;
    height: 32px;
    display: block;
    flex-shrink: 0;
}

.auth-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
}

.auth-modal-close {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.auth-modal-body {
    padding: 2rem 1.5rem;
}

/* More padding for registration form */
.auth-modal-content.register-form-active .auth-modal-body {
    padding: 2rem 2rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
}

.auth-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: -2px;
    position: relative;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab:hover {
    color: #667eea;
}

.auth-tab.active {
    color: #667eea;
}

.auth-tab.active::after {
    transform: scaleX(1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 20px;
}

.auth-form-row .auth-form-group {
    min-width: 0; /* Allow grid items to shrink below content size */
}

@media (max-width: 640px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile responsive styles for auth modal */
@media (max-width: 768px) {
    .auth-modal {
        padding: 0.5rem;
        padding-top: 2rem;
    }
    
    .auth-modal-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto;
        border-radius: 1rem;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    /* Override register form width on mobile */
    #auth-modal .auth-modal-content.register-form-active,
    #auth-modal .auth-modal-content[style*="max-width: 800px"] {
        max-width: 100% !important;
        width: 100% !important;
        min-width: auto !important;
    }
    
    .auth-modal-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .auth-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-modal-body {
        padding: 1.5rem 1rem !important;
    }
    
    .auth-modal-content.register-form-active .auth-modal-body {
        padding: 1.5rem 1rem !important;
    }
    
    .auth-tabs {
        margin-bottom: 1.5rem;
    }
    
    .auth-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 10px;
}

.auth-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-form-group label i {
    color: #667eea;
    font-size: 0.875rem;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.auth-form-group input {
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-width: 0; /* Allow input to shrink in grid */
    background: #f9fafb;
    box-sizing: border-box;
}

.auth-form-group input:hover {
    border-color: #d1d5db;
    background: white;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: #667eea;
}

.auth-form-group small {
    font-size: 0.75rem;
    color: #9ca3af;
}

.auth-submit-btn {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0.5rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px 0 rgba(102, 126, 234, 0.5);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn i,
.auth-submit-btn span {
    position: relative;
    z-index: 1;
}

.auth-submit-btn i {
    font-size: 1rem;
}

.auth-error {
    padding: 0.75rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #fecaca;
    margin-bottom: 20px;
}

/* Auth Overlay Styles */
.auth-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.auth-overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-overlay-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s ease-in-out infinite;
}

.auth-overlay-shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.auth-overlay-shape-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.auth-overlay-shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.auth-overlay-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 0;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-overlay-logo {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 3rem 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-overlay-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.auth-overlay-logo-icon {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.auth-logo-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
}

.auth-overlay-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-overlay-main {
    padding: 3rem 2.5rem;
    text-align: center;
}

.auth-overlay-heading {
    margin: 0 0 1rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.auth-overlay-description {
    margin: 0 0 2.5rem 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #6b7280;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.auth-overlay-actions {
    margin-bottom: 2rem;
}

.auth-overlay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.875rem;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-overlay-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-overlay-btn:hover::before {
    width: 300px;
    height: 300px;
}

.auth-overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px 0 rgba(102, 126, 234, 0.5);
}

.auth-overlay-btn:active {
    transform: translateY(0);
}

.auth-overlay-btn i,
.auth-overlay-btn span {
    position: relative;
    z-index: 1;
}

.auth-overlay-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.auth-overlay-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: #6b7280;
}

.auth-overlay-feature i {
    color: #10b981;
    font-size: 1rem;
}

@media (max-width: 640px) {
    .auth-overlay {
        padding: 1rem;
    }
    
    .auth-overlay-content {
        border-radius: 1.5rem;
    }
    
    .auth-overlay-logo {
        padding: 2.5rem 2rem 1.5rem;
    }
    
    .auth-overlay-logo-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .auth-overlay-title {
        font-size: 1.5rem;
    }
    
    .auth-overlay-main {
        padding: 2rem 1.5rem;
    }
    
    .auth-overlay-heading {
        font-size: 1.75rem;
    }
    
    .auth-overlay-description {
        font-size: 1rem;
    }
    
    .auth-overlay-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .auth-overlay-features {
        gap: 1rem;
    }
}

/* ===== DASHBOARD PAGE STYLES ===== */
.dashboard-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 100px;
    padding: 2.5rem 1.5rem;
    min-height: calc(100vh - 80px);
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Welcome Section */
.dashboard-welcome {
    text-align: center;
    padding: 3rem 0 2rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.dashboard-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin: 0 0 1rem 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dashboard-subtitle {
    font-size: 1.375rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stats Section */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.6);
}

.stat-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9375rem;
    margin-top: 0.5rem;
    color: #6b7280;
    font-weight: 500;
}

/* Quick Actions */
.dashboard-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.dashboard-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 2.5rem;
    border: none;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.dashboard-action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.dashboard-action-btn.primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 14px 0 rgba(255, 255, 255, 0.3);
}

.dashboard-action-btn.primary:hover {
    background: #f9fafb;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px 0 rgba(255, 255, 255, 0.4);
}

.dashboard-action-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.dashboard-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.15);
}

.dashboard-action-btn i {
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.dashboard-action-btn span {
    position: relative;
    z-index: 1;
}

/* Recent Widgets Section */
.dashboard-recent {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.dashboard-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2rem 0;
    letter-spacing: -0.02em;
}

.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #9ca3af;
}

.dashboard-empty i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.dashboard-empty p {
    font-size: 1.125rem;
    margin: 0;
    color: #6b7280;
    font-weight: 500;
}

@media (max-width: 768px) {
    .dashboard-title {
        font-size: 2.25rem;
    }
    
    .dashboard-subtitle {
        font-size: 1.125rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .dashboard-action-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .getting-started-steps {
        grid-template-columns: 1fr;
    }
}

/* Getting Started Section */
.dashboard-getting-started {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.getting-started-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.step-card {
    display: flex;
    gap: 1.25rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.step-card:hover::before {
    transform: scaleX(1);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.step-card:hover .step-number {
    transform: scale(1.1) rotate(5deg);
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.01em;
}

.step-content p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Widget Cards on Dashboard */
.widget-card {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.widget-card:hover::before {
    transform: scaleX(1);
}

.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(102, 126, 234, 0.2);
}

.widget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.widget-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.widget-card-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #9ca3af;
}

.widget-card-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.widget-card-btn i {
    font-size: 0.875rem;
}

.widget-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.widget-card-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.widget-card-date i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .dashboard-title {
        font-size: 2rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-actions {
        flex-direction: column;
    }
    
    .dashboard-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .getting-started-steps {
        grid-template-columns: 1fr;
    }
    
    .dashboard-widgets-grid {
        grid-template-columns: 1fr;
    }
}

/* CRITICAL: EMBEDDED WIDGET CLASSIC HEADER FIXES - HIGH SPECIFICITY */
/* These rules ensure embedded widgets match preview exactly */
.youtube-widget .classic-subheader .classic-content,
.widget-preview-content .classic-subheader .classic-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1rem !important;
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: left !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row,
.widget-preview-content .classic-subheader .classic-content .classic-header-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    flex: 1 !important;
    width: 100% !important;
    text-align: left !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-profile-image,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-profile-image {
    flex-shrink: 0 !important;
    order: 1 !important;
    margin: 0 !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-channel-info {
    flex: 1 !important;
    order: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    align-items: flex-start !important;
    text-align: left !important;
    width: auto !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-name {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-channel-description {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.youtube-widget .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats,
.widget-preview-content .classic-subheader .classic-content .classic-header-row .classic-channel-info .classic-stats {
    text-align: left !important;
    width: auto !important;
    margin: 0 !important;
}

.youtube-widget .classic-subheader .classic-content .classic-subscribe-section,
.widget-preview-content .classic-subheader .classic-content .classic-subscribe-section {
    flex-shrink: 0 !important;
    order: 3 !important;
    width: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin: 0 !important;
}

@media (min-width: 769px) {
    .youtube-widget .classic-subheader .classic-content,
    .widget-preview-content .classic-subheader .classic-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        max-width: 1200px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .youtube-widget .classic-subheader .classic-content .classic-header-row,
    .widget-preview-content .classic-subheader .classic-content .classic-header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        flex: 1 !important;
    }
}

/* Dashboard and App Selector Styles */
/* Show auth overlay by default */
#auth-overlay {
    display: flex !important;
}

/* Hide dashboard by default */
#dashboard-page {
    display: none !important;
}

/* Dashboard styles */
.dashboard-page {
    margin: 0;
    padding: 0;
    font-family: "Roboto", "Arial", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-selector-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 3rem;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-selector-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-selector-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.app-selector-header p {
    color: #6b7280;
    font-size: 1rem;
}

.app-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.app-selector-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-selector-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.app-selector-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.app-selector-card.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    pointer-events: none;
}

.app-selector-card.disabled:hover {
    border-color: #e5e7eb;
    transform: none;
    box-shadow: none;
}

.app-selector-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    padding: 8px;
    box-sizing: border-box;
}

.app-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.25rem;
}

.app-selector-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0.5rem 0;
}

.app-selector-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.logout-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Dashboard Recent Widgets Section */
.dashboard-recent {
    margin: 2rem 0;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.dashboard-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem 0;
}

.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-widget-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.6);
}

.dashboard-widget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.dashboard-widget-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.dashboard-widget-app-badge.youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.dashboard-widget-app-badge.instagram {
    background: linear-gradient(135deg, #E4405F 0%, #C13584 100%);
}

.dashboard-widget-app-badge.tiktok {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

.dashboard-widget-app-badge i {
    font-size: 1rem;
}

.dashboard-widget-badge-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.dashboard-widget-badge-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.dashboard-widget-date {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.dashboard-widget-card-body {
    flex: 1;
}

.dashboard-widget-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.dashboard-widget-template {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    text-transform: capitalize;
}

.dashboard-widget-card-footer {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-widget-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.dashboard-widget-link:hover {
    color: #764ba2;
    gap: 0.75rem;
}

.dashboard-widget-link i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.dashboard-widget-link:hover i {
    transform: translateX(2px);
}

.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #6b7280;
}

.dashboard-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dashboard-empty p {
    font-size: 1.125rem;
    margin: 0;
}

/* Stat icon colors for app types */
.stat-icon.youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.stat-icon.instagram {
    background: linear-gradient(135deg, #E4405F 0%, #C13584 100%);
}

.stat-icon.tiktok {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

/* Stat logo images */
.stat-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

/* Dashboard Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 50px;
    height: 50px;
    display: block;
}

.title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #3b82f6;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.nav-link i {
    font-size: 1rem;
}

/* User Account */
.user-account {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: #2563eb;
}

.user-avatar-container {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #3b82f6;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar-btn:hover {
    color: #2563eb;
    transform: scale(1.1);
}

.user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1001;
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    font-size: 0.875rem;
}

.user-info i {
    font-size: 1.5rem;
    color: #6b7280;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: #111827;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: #f3f4f6;
}

.user-menu-item i {
    width: 1.25rem;
    color: #6b7280;
}

/* Dashboard Container */
.dashboard-container {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dashboard-title-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.dashboard-title-section p {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
}

.dashboard-apps-section {
    margin-top: 3rem;
}

