/* Google Fonts loaded via <link> in HTML for better performance */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #2d3748;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #e2e8f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: row;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    border: 2px solid #cbd5e0;
    background: white;
    color: #4a5568;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.theme-toggle:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

body.dark .theme-toggle {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark .theme-toggle:hover {
    background: #4a5568;
}

.themes-menu-toggle {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    border: 2px solid #6d28d9;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.themes-menu-toggle:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.45);
}

body.dark .themes-menu-toggle {
    border-color: #6d28d9;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
}

body.dark .themes-menu-toggle:hover {
    filter: brightness(1.05);
}

.themes-menu-toggle.active {
    background: #7c3aed; /* vivid purple */
    border-color: #6d28d9;
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}

.themes-menu-toggle.active:hover {
    background: #6d28d9;
    border-color: #5b21b6;
}

body.dark .themes-menu-toggle.active {
    background: #7c3aed;
    border-color: #6d28d9;
    color: white;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.6);
}

body.dark .themes-menu-toggle.active:hover {
    background: #6d28d9;
    border-color: #5b21b6;
}

.hamburger {
    width: 20px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger .line {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.themes-menu-toggle.active .hamburger .line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.themes-menu-toggle.active .hamburger .line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.themes-menu-toggle.active .hamburger .line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.themes-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.themes-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.themes-menu {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-height: 70vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1101;
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    overflow-y: auto;
}

.themes-menu.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

body.dark .themes-menu {
    background: #1a202c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.themes-menu-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark .themes-menu-header {
    border-bottom-color: #4a5568;
}

.themes-menu-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
}

body.dark .themes-menu-header h3 {
    color: #e2e8f0;
}

.theme-toggle-container {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer; /* make whole row clickable */
    transition: background-color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

body.dark .theme-toggle-container {
    border-bottom-color: #4a5568;
}

.theme-toggle-label {
    color: #2d3748;
    font-weight: 500;
}

body.dark .theme-toggle-label {
    color: #f7fafc;
}

.theme-toggle-container:hover {
    background: #f7fafc;
    transform: translateX(5px);
}

body.dark .theme-toggle-container:hover {
    background: #2d3748;
}


.themes-menu-list {
    padding: 0;
}

.theme-menu-item {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #4a5568;
    border-bottom: 1px solid #f7fafc;
    transition: all 0.2s ease;
    font-size: 16px;
}

.theme-menu-item:hover {
    background: #f7fafc;
    color: #2d3748;
    transform: translateX(5px);
}

body.dark .theme-menu-item {
    color: #e2e8f0;
    border-bottom-color: #2d3748;
}

body.dark .theme-menu-item:hover {
    background: #2d3748;
    color: #f7fafc;
}

.theme-menu-item-icon {
    margin-right: 10px;
    font-size: 18px;
}

@media (max-width: 768px) {
    .themes-menu {
        bottom: 90px;
        right: 15px;
        left: 15px;
        width: auto;
        max-height: 65vh;
    }
    
    .theme-switcher {
        bottom: 15px;
        right: 15px;
    }
    
    .themes-menu-toggle {
        width: 60px;
        height: 60px;
        border-radius: 30px;
        font-size: 26px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        border-radius: 20px;
        font-size: 18px;
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
}

body.dark header {
    color: #f7fafc;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

body.dark header h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.generator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.input-panel,
.puzzle-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark .input-panel,
body.dark .puzzle-panel {
    background: #2d3748;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.input-panel h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

body.dark .input-panel h2 {
    color: #f7fafc;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

body.dark .form-group label {
    color: #e2e8f0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.875rem;
}

body.dark .form-group small {
    color: #a0aec0;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #4a5568;
    opacity: 0.8;
}

body.dark footer {
    color: #cbd5e0;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset legend {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1rem;
}

body.dark fieldset legend {
    color: #e2e8f0;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
    font-size: 0.9rem;
}

body.dark .checkbox-item {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.checkbox-item:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

body.dark .checkbox-item:hover {
    border-color: #6b7280;
    background: #4b5563;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.checkbox-item:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

body.dark .checkbox-item:has(input:checked) {
    border-color: #667eea;
    background: #1e3a8a;
}

.checkmark {
    flex: 1;
}

.error-message,
.warning-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
}

body.dark .error-message {
    background: #4c1d1d;
    border-color: #7f1d1d;
    color: #f87171;
}

.warning-message {
    background: #fffbeb;
    border: 2px solid #fed7aa;
    color: #d97706;
}

body.dark .warning-message {
    background: #451a03;
    border-color: #9a3412;
    color: #fb923c;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); /* purple pop */
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.tab {
    background: #edf2f7;
    border: 2px solid #e2e8f0;
    color: #2d3748;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.tab.active {
    background: #eef2ff;
    border-color: #667eea;
}

body.dark .tab {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark .tab.active {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.tab-panel[hidden] {
    display: none;
}

.puzzle-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.placeholder-hint {
    font-size: 0.9rem;
    margin-top: 10px;
}

#puzzle-display {
    margin-bottom: 30px;
}

.puzzle-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 20px;
}

body.dark .puzzle-title {
    color: #f7fafc;
}

.puzzle-grid {
    display: inline-block;
    border: 2px solid #4a5568;
    margin-bottom: 20px;
}

body.dark .puzzle-grid {
    border-color: #e2e8f0;
}

.grid-row {
    display: flex;
}

.grid-cell {
    width: 25px;
    height: 25px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
    font-size: 18px;
    background: #fafbfc;
    color: #000000;
}


.word-list {
    text-align: center;
}

.word-list h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

body.dark .word-list h3 {
    color: #e2e8f0;
}

.words-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}

.word-item {
    padding: 10px 14px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.dark .word-item {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.words-list-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #374151;
    white-space: normal;
    min-height: 100px;
    max-width: 400px;
    margin: 0 auto;
    cursor: default;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

body.dark .words-list-container {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

#theme-words-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #374151;
    resize: vertical;
    min-height: 120px;
    cursor: default;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

body.dark #theme-words-preview {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.puzzle-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Button Base Styles */
.download-btn,
.print-btn,
.secondary-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Download PDF Button - Blue theme to match primary */
.download-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

/* Print Button - Ocean blue theme */
.print-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.print-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Secondary buttons - Gray theme for less emphasis */
.secondary-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #cbd5e0;
}

.secondary-btn:hover {
    background: #cbd5e0;
    border-color: #a0aec0;
    transform: translateY(-1px);
}

/* Secondary action button - Shuffle (theme pages) */
#shuffle-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: 2px solid #0891b2;
    font-weight: 600;
}

#shuffle-btn:hover {
    background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
    border-color: #0e7490;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3);
}

/* Secondary action button - Shuffle (main page) */
#new-puzzle-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: 2px solid #0891b2;
    font-weight: 600;
}

#new-puzzle-btn:hover {
    background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
    border-color: #0e7490;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3);
}



/* Dark mode button adjustments */
body.dark .download-btn {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

body.dark .download-btn:hover {
    background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

body.dark .print-btn {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
}

body.dark .print-btn:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

body.dark .secondary-btn {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #6b7280;
}

body.dark .secondary-btn:hover {
    background: #6b7280;
    border-color: #9ca3af;
}

/* Dark mode for secondary action button - Shuffle (theme pages) */
body.dark #shuffle-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
}

body.dark #shuffle-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-color: #0891b2;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}

/* Dark mode for secondary action button - Shuffle (main page) */
body.dark #new-puzzle-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
}

body.dark #new-puzzle-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-color: #0891b2;
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}


/* Theme quick-pick row */
.theme-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-browse-btn {
    white-space: nowrap;
}

/* Theme Assistant (chat-style) */
.assistant {
    margin-top: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

body.dark .assistant {
    background: #2d3748;
    border-color: #4b5563;
}

.assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

body.dark .assistant-header {
    background: #374151;
    border-color: #4b5563;
}

.assistant-title {
    font-weight: 600;
}

.assistant-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.95rem;
}

.assistant-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.assistant-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 100%;
    line-height: 1.35;
}

.assistant-bubble.assistant {
    background: #eef2ff;
    border: 2px solid #c7d2fe;
}

body.dark .assistant-bubble.assistant {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.assistant-bubble.user {
    background: #ecfeff;
    border: 2px solid #a5f3fc;
}

body.dark .assistant-bubble.user {
    background: #0e7490;
    border-color: #22d3ee;
}

.assistant-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.assistant-actions .secondary-btn {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.assistant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assistant-chip {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}

body.dark .assistant-chip {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.assistant-chip:hover {
    border-color: #667eea;
}

.theme-assistant-controls {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .generator-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .input-panel,
    .puzzle-panel {
        padding: 20px;
    }

    .puzzle-actions {
        flex-direction: column;
    }

    .grid-cell {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

@print {
    body {
        background: white !important;
        color: black !important;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 20px;
    }

    .generator-section {
        display: block;
    }

    .input-panel {
        display: none !important;
    }

    .puzzle-panel {
        box-shadow: none;
        border-radius: 0;
        background: white;
        padding: 0;
    }

    .puzzle-actions {
        display: none !important;
    }

    header {
        display: none !important;
    }

    .puzzle-title {
        color: black !important;
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .puzzle-grid {
        border: 3px solid black;
    }

    .grid-cell {
        border: none;
        width: 30px;
        height: 30px;
        font-size: 20px;
        background: white !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        color: #000000 !important;
    }


    .word-list {
        display: block !important;
        page-break-inside: avoid;
        margin-top: 30px;
    }

    .word-list h3 {
        color: black !important;
        font-size: 1.3rem;
        margin: 30px 0 20px 0;
    }

    .words-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 500px;
        margin: 0 auto;
    }

    .word-item {
        background: white !important;
        border: 2px solid black;
        padding: 10px;
        font-size: 1rem;
        text-align: center;
        border-radius: 0;
    }

    .puzzle-placeholder {
        display: none !important;
    }
}

/* Themes Showcase Section */
.themes-showcase {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

body.dark .themes-showcase {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.themes-showcase h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

body.dark .themes-showcase h2 {
    color: #e2e8f0;
}

.themes-showcase p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

body.dark .themes-showcase p {
    color: #a0aec0;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

body.dark .theme-card {
    background: #4a5568;
    border-color: #718096;
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0ea5e9;
}

body.dark .theme-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: #7c3aed;
}

.theme-card-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.theme-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

body.dark .theme-card-name {
    color: #e2e8f0;
}

.theme-card-description {
    font-size: 0.9rem;
    color: #718096;
}

body.dark .theme-card-description {
    color: #a0aec0;
}

/* Theme Page Specific Styles */
.back-link {
    margin-bottom: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #0ea5e9;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.back-button:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* FAQ Section */
.faq-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

body.dark .faq-section {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.faq-section h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

body.dark .faq-section h2 {
    color: #e2e8f0;
}

.faq-section .intro {
    color: #718096;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

body.dark .faq-section .intro {
    color: #a0aec0;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

body.dark .faq-item {
    border-color: #4b5563;
    background: #374151;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

body.dark .faq-item summary {
    color: #e2e8f0;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item .chevron {
    color: #718096;
    transition: transform 0.2s ease;
}

.faq-item[open] .chevron {
    transform: rotate(180deg);
}

.faq-item summary:hover {
    background: #eef2ff;
}

body.dark .faq-item summary:hover {
    background: #1e3a8a;
}

.faq-item .answer {
    padding: 0 16px 16px 16px;
    color: #4a5568;
    line-height: 1.5;
}

body.dark .faq-item .answer {
    color: #cbd5e0;
}

.theme-puzzle-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

body.dark .theme-puzzle-section {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-info {
    text-align: center;
    margin-bottom: 30px;
}

.theme-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.theme-info h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

body.dark .theme-info h2 {
    color: #e2e8f0;
}

.theme-info p {
    color: #718096;
    font-size: 1.1rem;
}

body.dark .theme-info p {
    color: #a0aec0;
}

.theme-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

body.dark .theme-actions {
    border-top-color: #4a5568;
}

.main-site-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
}

.main-site-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.theme-info-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

body.dark .theme-info-section {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-details h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 15px;
}

body.dark .theme-details h3 {
    color: #e2e8f0;
}

.theme-details p {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 20px;
}

body.dark .theme-details p {
    color: #a0aec0;
}

.theme-features h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

body.dark .theme-features h4 {
    color: #e2e8f0;
}

.theme-features ul {
    list-style: none;
    padding: 0;
}

.theme-features li {
    color: #718096;
    margin-bottom: 8px;
    padding-left: 0;
}

body.dark .theme-features li {
    color: #a0aec0;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .themes-showcase {
        padding: 20px;
    }

    .themes-showcase h2 {
        font-size: 1.5rem;
    }

    .themes-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .theme-card {
        padding: 15px;
    }

    .theme-card-icon {
        font-size: 2rem;
    }

    .theme-card-name {
        font-size: 1rem;
    }

    .theme-card-description {
        font-size: 0.8rem;
    }

    /* Theme page mobile styles */
    .theme-puzzle-section,
    .theme-info-section {
        padding: 20px;
    }

    .theme-icon {
        font-size: 2.5rem;
    }

    .theme-info h2 {
        font-size: 1.5rem;
    }

    .back-button,
    .main-site-link {
        width: 100%;
        justify-content: center;
    }
}
