/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Canva App Layout */
.canva-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.canva-header {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left .logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.02em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 480px;
    margin: 0 24px;
}

.header-center .search-container {
    width: 100%;
    position: relative;
}

.header-center .search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #374151;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.2s ease;
}

.header-center .search-input::placeholder {
    color: #9ca3af;
}

.header-center .search-input:focus {
    outline: none;
    border-color: #2a9d8f;
    background: #4b5563;
}

.header-center .search-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    min-width: 130px;
    justify-content: flex-start;
    gap: 6px;
    font-weight: 600;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.theme-toggle-icon svg {
    width: 18px;
    height: 18px;
}

.theme-toggle-icon-sun {
    color: #fcd34d;
    display: none;
}

.theme-toggle-icon-moon {
    color: #a78bfa;
}

.theme-toggle-label {
    font-size: 13px;
}

/* Header Buttons - Consistent Styling */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    height: 36px;
    box-sizing: border-box;
}

.header-btn svg,
.header-btn .ui-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.header-btn .ui-icon svg {
    width: 16px;
    height: 16px;
}

.header-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.header-btn-accent {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #ffffff;
    border: none;
}

.header-btn-accent:hover {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.header-btn-image {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: #ffffff;
    border: none;
}

.header-btn-image:hover {
    background: linear-gradient(135deg, #4338ca, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.45);
}

.header-btn-primary {
    background: #2a9d8f;
    color: #ffffff;
    border: none;
}

.header-btn-primary:hover {
    background: #238b7d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.4);
}

/* User Avatar in Header */
.header-right .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-right .user-avatar:hover {
    background: rgba(255, 255, 255, 0.15);
}

.header-right .user-avatar svg {
    width: 20px;
    height: 20px;
}

.user-avatar:hover {
    background: #238b7d;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px 20px;
    overflow-y: auto;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #64748b;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-menu svg {
    width: 16px;
    height: 16px;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-menu li.active a,
.sidebar-menu a:hover {
    background: #f8fafc;
    color: #2a9d8f;
}

/* Design Types Grid */
.design-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.design-type {
    padding: 16px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.design-type:hover {
    border-color: #2a9d8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.design-icon {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a9d8f;
}

.design-icon svg {
    width: 24px;
    height: 24px;
    color: inherit;
}

.design-type span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 4px;
}

.design-type small {
    font-size: 11px;
    color: #94a3b8;
}

/* Center Content */
.center-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 32px;
}

.content-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    position: relative;
}

.filter-tab.active,
.filter-tab:hover {
    color: #2a9d8f;
    background: #f8fafc;
}

.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #2a9d8f;
    border-radius: 5px;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.template-card {
    background: radial-gradient(circle at top, rgba(248, 250, 252, 0.95), #ffffff 70%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06);
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 55px rgba(15, 23, 42, 0.18);
    border-color: rgba(42, 157, 143, 0.35);
}

.template-preview {
    position: relative;
    aspect-ratio: 3/2;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumb-frame {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: none;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    position: relative;
}

.template-thumb-frame img {
    max-width: 100%;
    max-height: 100%;
    max-height: calc(100% - 6px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(1.02) contrast(1.05);
    display: block;
}

.template-card:hover .template-thumb-frame img {
    transform: scale(1.05);
    filter: brightness(1.05) contrast(1.08);
}

.template-thumb-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b21b6 0%, #0ea5e9 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    font-size: 15px;
    font-weight: 600;
}

.template-thumb-placeholder-letter {
    font-size: 28px;
    font-weight: 700;
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.92) 0%, rgba(35, 139, 125, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.template-card:hover .template-overlay {
    opacity: 1;
}

/* Custom Checkbox for Design Cards */
.design-checkbox-wrapper {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    cursor: pointer;
}

.design-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.design-checkbox-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(148, 163, 184, 0.4);
    border-radius: 6px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.design-checkbox-custom svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
    stroke: white;
}

.design-checkbox-wrapper:hover .design-checkbox-custom {
    border-color: #7c3aed;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.design-checkbox-wrapper input:checked + .design-checkbox-custom {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-color: #7c3aed;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.design-checkbox-wrapper input:checked + .design-checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

/* Show checkbox on hover or when checked */
.template-card .design-checkbox-wrapper {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-card:hover .design-checkbox-wrapper,
.template-card .design-checkbox-wrapper:has(input:checked) {
    opacity: 1;
}

/* Always show if any checkbox is checked (bulk mode) */
.templates-grid.bulk-mode .design-checkbox-wrapper {
    opacity: 1;
}

/* Select All Checkbox */
.select-all-checkbox-custom {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.select-all-checkbox-custom input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.select-all-checkbox-custom .checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.select-all-checkbox-custom .checkmark svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
    stroke: white;
}

.select-all-checkbox-wrapper:hover .checkmark {
    border-color: #7c3aed;
}

.select-all-checkbox-custom input:checked + .checkmark {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-color: #7c3aed;
}

.select-all-checkbox-custom input:checked + .checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.use-template-btn {
    background: linear-gradient(135deg, #2a9d8f 0%, #238b7d 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

.use-template-btn:hover {
    background: linear-gradient(135deg, #238b7d 0%, #1d7569 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(42, 157, 143, 0.4);
}

/* Blank Template */
.blank-template .template-preview {
    background: transparent;
}

.blank-template .template-thumb-frame {
    background: linear-gradient(135deg, #2a9d8f 0%, #238b7d 100%);
    border: none;
    box-shadow: none;
    color: #ffffff;
    flex-direction: column;
    gap: 10px;
}

.blank-icon {
    margin-bottom: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blank-icon svg {
    width: 32px;
    height: 32px;
    color: inherit;
}

.blank-template .template-thumb-frame span {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

/* Template Info */
.template-info {
    padding: 18px;
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
}

.template-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.3;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-type {
    font-size: 12px;
    font-weight: 600;
    color: #2a9d8f;
    background: #e6f7f5;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #c7ede9;
}

.template-rating {
    font-size: 12px;
    color: #f39c12;
}

/* Load More */
.load-more-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    line-height: 1;
}

.btn-primary {
    background: #2a9d8f;
    color: white;
    box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
    background: #238b7d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: #2a9d8f;
    border-color: #cbd5e1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .center-content {
        padding: 24px 20px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 16px;
    }
    
    .design-types-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .center-content {
        padding: 16px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .header-center {
        margin: 0 16px;
    }
    
    .filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.template-card {
    animation: fadeIn 0.4s ease-out;
}

.template-card:nth-child(even) {
    animation-delay: 0.1s;
}

.template-card:nth-child(3n) {
    animation-delay: 0.2s;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #2a9d8f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scrollbars */
.sidebar::-webkit-scrollbar,
.center-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.center-content::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 5px;
}

.sidebar::-webkit-scrollbar-thumb,
.center-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.center-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =============================================
   FOLDERS PANEL STYLES
   ============================================= */

/* Folders Section Header */
.folders-section {
    margin-top: 8px;
}

.folders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: #64748b;
    font-size: 14px;
}

.folders-header > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folders-header svg {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.create-folder-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.create-folder-btn:hover {
    background: #f1f5f9;
    color: #2a9d8f;
}

/* Folders List */
.folders-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-item {
    margin-bottom: 2px;
}

.folder-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.folder-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #94a3b8;
}

.folder-link:hover {
    background: #f8fafc;
}

.folder-link:hover svg {
    color: #2a9d8f;
}

.folder-link.active {
    background: #ecfdf5;
}

.folder-link.active svg {
    color: #2a9d8f;
}

.folder-link.active .folder-name {
    color: #0f172a;
    font-weight: 500;
}

.folder-name {
    flex: 1;
    font-size: 14px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.folder-count {
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Folder Actions (Edit/Delete) */
.folder-actions {
    display: none;
    gap: 4px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.folder-item:hover .folder-actions {
    display: flex;
}

.folder-item:hover .folder-count {
    display: none;
}

.folder-action-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.folder-action-btn:hover {
    background: #f1f5f9;
    color: #2a9d8f;
}

.folder-action-btn.folder-delete-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* No folders message */
.no-folders-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

.create-first-folder-btn {
    background: none;
    border: 1px dashed #cbd5e1;
    padding: 6px 14px;
    border-radius: 6px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-first-folder-btn:hover {
    border-color: #2a9d8f;
    color: #2a9d8f;
    background: #f0fdfa;
}

/* Drag and Drop Styles */
.folder-link.drag-over {
    background: #ecfdf5;
    border: 2px dashed #2a9d8f;
    padding: 8px 10px;
}

.template-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* =============================================
   MODAL STYLES
   ============================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.25s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 28px 24px;
}

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-footer .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.modal-footer .btn-secondary:hover {
    background: #e5e7eb;
}

.modal-footer .btn-primary {
    background: #2a9d8f;
    color: #ffffff;
    border: none;
}

.modal-footer .btn-primary:hover {
    background: #238b7d;
}

/* Folder Menu (dropdown) */
.folder-menu {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 220px;
    overflow: hidden;
    animation: menuSlideIn 0.15s ease-out;
}

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

.folder-menu-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.folder-menu-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.folder-menu-content {
    padding: 8px 0;
    max-height: 280px;
    overflow-y: auto;
}

.folder-menu .folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.1s ease;
}

.folder-menu .folder-item:hover {
    background: #f8fafc;
}

.folder-menu .folder-item svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.folder-menu .folder-item:hover svg {
    color: #2a9d8f;
}

.folder-menu .folder-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
}

.folder-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 0;
}

.folder-menu .create-folder {
    color: #2a9d8f;
    font-weight: 500;
}

.folder-menu .create-folder svg {
    color: #2a9d8f;
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 11000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background: #10b981;
    color: #ffffff;
}

.notification-error {
    background: #ef4444;
    color: #ffffff;
}

.notification-warning {
    background: #f59e0b;
    color: #ffffff;
}

.notification-info {
    background: #3b82f6;
    color: #ffffff;
}

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */
body.dark-mode {
    background-color: #020617;
    color: #e2e8f0;
    color-scheme: dark;
}

body.dark-mode .canva-app,
body.dark-mode .main-content,
body.dark-mode .center-content {
    background: #020617;
}

body.dark-mode .canva-header {
    background: #0f172a;
    border-bottom-color: #1e293b;
    box-shadow: 0 15px 35px rgba(2, 6, 23, 0.65);
}

body.dark-mode .header-center .search-input {
    background: #1f2937;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .header-center .search-input:focus {
    border-color: #2dd4bf;
    background: #111827;
}

body.dark-mode .header-center .search-input::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .header-center .search-btn {
    color: #94a3b8;
}

body.dark-mode .header-btn-secondary {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}

body.dark-mode .header-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.25);
}

body.dark-mode .header-right .user-avatar {
    background: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
}

body.dark-mode .theme-toggle-icon-sun {
    display: inline-flex;
}

body.dark-mode .theme-toggle-icon-moon {
    display: none;
}

body.dark-mode .sidebar {
    background: #0f172a;
    border-right-color: #1f2937;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.8);
}

body.dark-mode .sidebar-section h3,
body.dark-mode .folders-header,
body.dark-mode .folders-header span,
body.dark-mode .folders-header svg {
    color: #e2e8f0;
}

body.dark-mode .create-folder-btn {
    color: #94a3b8;
}

body.dark-mode .create-folder-btn:hover {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-mode .sidebar-menu a {
    color: #cbd5f5;
}

body.dark-mode .sidebar-menu svg {
    color: #94a3b8;
}

body.dark-mode .sidebar-menu li.active a,
body.dark-mode .sidebar-menu a:hover,
body.dark-mode .folder-link:hover {
    background: rgba(45, 212, 191, 0.08);
    color: #5eead4;
}

body.dark-mode .sidebar-menu li.active a svg,
body.dark-mode .sidebar-menu a:hover svg,
body.dark-mode .folder-link:hover svg {
    color: #5eead4;
}

body.dark-mode .folder-link {
    color: #94a3b8;
}

body.dark-mode .folder-link .folder-count {
    background: #1e293b;
    color: #94a3b8;
}

body.dark-mode .no-folders {
    color: #94a3b8;
}

body.dark-mode .design-type {
    background: #0f172a;
    border-color: #1f2937;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
}

body.dark-mode .design-type:hover {
    border-color: #2dd4bf;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
}

body.dark-mode .design-type span {
    color: #f8fafc;
}

body.dark-mode .design-type small,
body.dark-mode .designs-controls label,
body.dark-mode .content-header h2,
body.dark-mode .templates-section h3,
body.dark-mode #folder-modal-description {
    color: #cbd5f5 !important;
}

body.dark-mode .design-icon {
    color: #5eead4;
}

body.dark-mode .filter-tabs {
    border-bottom-color: #1e293b;
}

body.dark-mode .filter-tab {
    color: #94a3b8;
}

body.dark-mode .filter-tab.active,
body.dark-mode .filter-tab:hover {
    color: #5eead4;
    background: rgba(45, 212, 191, 0.08);
}

body.dark-mode .filter-tab.active::after {
    background: #2dd4bf;
}

body.dark-mode #designs-count,
body.dark-mode #templates-count {
    color: #a5b4fc !important;
}

body.dark-mode #bulk-actions-bar {
    background: #0f766e !important;
    color: #e0f2fe !important;
    box-shadow: 0 10px 30px rgba(15, 118, 110, 0.45) !important;
}

body.dark-mode .template-card {
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #0f172a 70%);
    border-color: rgba(51, 65, 85, 0.7);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
}

body.dark-mode .template-card:hover {
    border-color: rgba(94, 234, 212, 0.4);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.85);
}

body.dark-mode .template-preview {
    background: linear-gradient(135deg, #1f2937, #0f172a);
}

body.dark-mode .template-thumb-frame {
    background: rgba(15, 23, 42, 0.85);
}

body.dark-mode .template-info {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.95));
}

body.dark-mode .template-info h4 {
    color: #f8fafc;
}

body.dark-mode .template-meta span {
    color: #94a3b8 !important;
}

body.dark-mode .template-type {
    color: #5eead4;
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.3);
}

body.dark-mode .template-thumb-placeholder {
    background: linear-gradient(135deg, #4338ca, #1e3a8a);
}

body.dark-mode .blank-template .template-thumb-frame {
    background: linear-gradient(135deg, #0d9488, #115e59);
}

body.dark-mode .blank-template p {
    color: #cbd5f5 !important;
}

body.dark-mode .design-actions .action-btn {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

body.dark-mode .design-actions .action-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(94, 234, 212, 0.4);
    color: #5eead4;
}

body.dark-mode .star-btn.starred {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.35);
}

body.dark-mode .floating-create-option {
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.75);
}

body.dark-mode .floating-create-option-icon {
    background: rgba(79, 70, 229, 0.25);
    color: #c4b5fd;
}

body.dark-mode .floating-create-main {
    box-shadow: 0 25px 45px rgba(91, 33, 182, 0.5);
}

body.dark-mode .folders-list,
body.dark-mode .folders-list li,
body.dark-mode .folder-menu {
    background: transparent;
}

body.dark-mode .folder-menu,
body.dark-mode .modal-container,
body.dark-mode #folder-selection-modal > div,
body.dark-mode #image-to-design-dashboard-modal > div,
body.dark-mode #ai-design-modal > div {
    background: #0f172a !important;
    color: #f8fafc;
    border-color: #1f2937;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.85);
}

body.dark-mode .folder-menu-header,
body.dark-mode #image-to-design-dashboard-modal header,
body.dark-mode #ai-design-modal header,
body.dark-mode .modal-header {
    border-bottom-color: #1f2937 !important;
}

body.dark-mode .folder-menu .folder-item {
    color: #e2e8f0;
}

body.dark-mode .folder-menu .folder-item:hover {
    background: rgba(148, 163, 184, 0.1);
}

body.dark-mode .folder-menu .folder-item svg,
body.dark-mode .folder-menu .create-folder svg {
    color: #94a3b8;
}

body.dark-mode .folder-menu .folder-count {
    color: #94a3b8;
}

body.dark-mode .folder-action-btn {
    background: #1f2937;
    color: #e2e8f0;
    box-shadow: none;
}

body.dark-mode .folder-action-btn:hover {
    background: #0f172a;
    color: #5eead4;
}

body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode textarea,
body.dark-mode select {
    background: #0f172a !important;
    border-color: #1f2937 !important;
    color: #f8fafc !important;
    box-shadow: none;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #2dd4bf !important;
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35);
}

body.dark-mode select option {
    background: #0f172a;
}

body.dark-mode #template-search,
body.dark-mode #template-category-filter,
body.dark-mode #sort-designs,
body.dark-mode #filter-designs {
    background: #0f172a !important;
}

body.dark-mode #dashboard-image-dropzone {
    border-color: #1f2937 !important;
    background: rgba(15, 23, 42, 0.65) !important;
}

body.dark-mode #dashboard-image-indicator {
    border-color: rgba(129, 140, 248, 0.5) !important;
    background: rgba(49, 46, 129, 0.55) !important;
    color: #c7d2fe !important;
}

body.dark-mode #dashboard-image-preview {
    background: #0b1424 !important;
    border-color: #1f2937 !important;
    color: #e2e8f0;
}

body.dark-mode #dashboard-image-preview img {
    border-color: #1f2937;
}

body.dark-mode #dashboard-image-preview button,
body.dark-mode #dashboard-image-clear {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #e2e8f0 !important;
}

body.dark-mode #dashboard-image-status,
body.dark-mode #ai-design-status {
    color: #fca5a5 !important;
}

body.dark-mode #image-to-design-dashboard-modal,
body.dark-mode #ai-design-modal,
body.dark-mode #folder-selection-modal,
body.dark-mode #rename-folder-modal {
    background: rgba(2, 6, 23, 0.85);
}

body.dark-mode #image-to-design-dashboard-modal p,
body.dark-mode #ai-design-modal p,
body.dark-mode .modal-overlay p,
body.dark-mode label {
    color: #cbd5f5 !important;
}

body.dark-mode h2,
body.dark-mode .modal-header h2,
body.dark-mode #image-to-design-dashboard-modal h2,
body.dark-mode #ai-design-modal h2 {
    color: #f8fafc !important;
}

body.dark-mode .modal-close {
    color: #94a3b8;
}

body.dark-mode .modal-close:hover {
    background: #1f2937;
    color: #f8fafc;
}

body.dark-mode .modal-footer .btn-secondary {
    background: #1f2937;
    color: #f8fafc;
    border-color: #1f2937;
}

body.dark-mode .modal-footer .btn-secondary:hover {
    background: #0f172a;
}

body.dark-mode .notification {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
