/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

/* Universal overflow prevention for all screen sizes */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all major containers don't exceed viewport width */
.header, .main, .container, .app-grid, 
.left-column, .right-panels, .panel, 
.panel-header, .panel-content, .preview-panel, 
.output-panel, .shadow-layer, .shadow-layer-header,
.saved-shadows-container, .recommended-shadows-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Prevent input elements from causing overflow */
input, select, textarea, button {
    max-width: 100%;
}

/* Prevent flexbox items from overflowing */
.flex, .flexbox, [style*="display: flex"] {
    min-width: 0;
}

/* Prevent grid items from overflowing */
.grid, [style*="display: grid"] {
    min-width: 0;
}

/* Universal text truncation for long content */
h1, h2, h3, h4, h5, h6, p, span, div, label {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Specific fixes for common overflow culprits */
.preview-header-actions, .output-actions, .header-actions {
    flex-wrap: wrap;
    min-width: 0;
}

.shadow-controls, .preview-controls-content, .shadow-layer-controls {
    min-width: 0;
}

.saved-shadows-container, .recommended-shadows-container {
    flex-wrap: wrap;
    min-width: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    min-height: 100vh;
    transition: all 0.3s ease;
}


/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px 0 rgba(102, 126, 234, 0.15);
}


.header-content {
    max-width: 1336px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
    text-decoration: none;
}

.logo:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

.logo-image {
    width: 232px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

body.light .logo-text h1 {
    color: #1e293b;
}

.logo-text p {
    font-size: 0.875rem;
    color: #64748b;
}

body.light .logo-text p {
    color: #64748b;
}

/* Ensure header-content colors work in all themes */
.header-content .logo-text h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.internal-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.internal-nav .nav-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.internal-nav .nav-link:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    text-decoration: none;
}

.internal-nav .nav-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.internal-nav .nav-link.active {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.home-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.home-link:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    text-decoration: none;
}

.home-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumb-link:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

.breadcrumb-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.breadcrumb-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    color: #94a3b8;
    margin: 0 0.25rem;
}

.breadcrumb-separator svg {
    width: 12px;
    height: 12px;
}

.breadcrumb-item.active {
    color: #1e293b;
}

.breadcrumb-current {
    font-weight: 600;
    color: #1e293b;
    padding: 0.25rem 0.5rem;
}

/* Reset Button */
.reset-btn {
    background: #dc2626;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.reset-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.reset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}


/* Main Layout */
.main {
    padding: 2rem 0;
}

/* Box Shadow Guide Section */
.box-shadow-guide-section {
    background: #ffffff;
    padding: 4rem 0;
    border-top: 1px solid #e2e8f0;
}

.guide-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.guide-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.guide-intro {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 0.75rem;
    border-left: 4px solid #3b82f6;
    margin-bottom: 3rem;
}

.guide-intro p {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
}

.guide-section {
    margin-bottom: 3rem;
}

.guide-section h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.guide-section p {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.guide-section strong {
    color: #1e293b;
    font-weight: 600;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    color: #10b981;
}

.syntax-list {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

.syntax-list li {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.syntax-list li:last-child {
    margin-bottom: 0;
}

.syntax-list strong {
    color: #1e293b;
    font-weight: 600;
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.parameter-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.parameter-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.parameter-item p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.parameter-item code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.example-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.example-item h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    position: relative;
}

.example-item h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 2px;
}

.example-preview {
    width: 140px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-demo-box {
    width: 90px;
    height: 60px;
    background: #3b82f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

/* Specific shadow examples with enhanced visuals */
.basic-shadow .shadow-demo-box {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.glow-shadow .shadow-demo-box {
    box-shadow: 0 0 20px #ff0000, 0 0 40px rgba(255, 0, 0, 0.3);
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.multiple-shadow .shadow-demo-box {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    background: linear-gradient(135deg, #10b981, #059669);
}

.inset-shadow .shadow-demo-box {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.neumorphic-shadow {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.neumorphic-shadow .shadow-demo-box {
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #374151;
}

.dramatic-shadow .shadow-demo-box {
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.example-item code {
    display: block;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    word-break: break-all;
    text-align: left;
    border-left: 4px solid #3b82f6;
}

.example-item p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.advanced-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.advanced-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.advanced-item h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    position: relative;
}

.advanced-item h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    border-radius: 2px;
}

.advanced-item .example-preview {
    width: 140px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.advanced-item .shadow-demo-box {
    width: 90px;
    height: 60px;
    background: #3b82f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

/* Advanced shadow examples with enhanced visuals */
.neumorphic-advanced {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.neumorphic-advanced .shadow-demo-box {
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #374151;
}

.inset-advanced .shadow-demo-box {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.complex-layered .shadow-demo-box {
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.08);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.advanced-item code {
    display: block;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    word-break: break-all;
    text-align: left;
    border-left: 4px solid #8b5cf6;
}

.advanced-item p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.best-practices {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.best-practices h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 1rem;
}

.best-practices ul {
    margin: 0;
    padding-left: 1.5rem;
}

.best-practices li {
    color: #0c4a6e;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.guide-image {
    text-align: center;
    margin: 2rem 0;
}

.guide-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.image-caption {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
    margin-top: 0.75rem;
}

.cta-box {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    padding: 2rem;
    border-radius: 0.75rem;
    text-align: center;
    margin: 2rem 0;
}

.cta-box p {
    font-size: 1.125rem;
    margin: 0;
    color: #ffffff;
}

/* How to Use Section - FAQ */
.how-to-use-section {
    background: #f8fafc;
    padding: 4rem 0;
    border-top: 1px solid #e2e8f0;
}

.how-to-use-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.how-to-use-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 3rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    background: #ffffff;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-question h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
}

.faq-icon {
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.footer-content h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-content p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-content p:last-child {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    align-items: start;
}

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

.right-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-controls-panel {
    height: fit-content;
    min-width: 0;
}

.preview-controls-panel .panel-content {
    overflow: hidden;
}

/* Panels */
.panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

body.light .panel {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.panel-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.light .panel-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.panel-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

body.light .panel-header h2 {
    color: #1e293b;
}

/* Collapse Toggle Button - Redesigned */
.collapse-toggle {
    background: #f8fafc;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 32px;
    height: 32px;
}

.collapse-toggle:hover {
    color: #3b82f6;
    background: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light .collapse-toggle {
    color: #94a3b8;
}

body.light .collapse-toggle:hover {
    color: #3b82f6;
    /* background: #1e293b; */
}

.collapse-icon {
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
    color: inherit;
}

.collapse-toggle.expanded .collapse-icon {
    transform: rotate(180deg);
}

/* Collapse Functionality */
.panel-content.collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: all 0.3s ease;
}

.panel-content:not(.collapsed) {
    transition: all 0.3s ease;
}

.panel-content {
    padding: 0.5rem;
}

/* Shadow Panel */
.add-btn {
    background: #10b981;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.shadow-layers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shadow-layer {
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

body.light .shadow-layer {
    background: #f8fafc;
    border-color: #e2e8f0;
}


/* Removed duplicate shadow-layer-header styles - using the ones below */

.shadow-layer-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.875rem;
}

body.light .shadow-layer-title {
    color: #1e293b;
}

.remove-shadow {
    background: #dc2626;
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.remove-shadow:hover {
    background: #b91c1c;
}

.shadow-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.shadow-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shadow-control label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

body.light .shadow-control label {
    color: #64748b;
}

.shadow-control input {
    padding: 0.5rem;
    background: #475569;
    border: 1px solid #64748b;
    border-radius: 0.375rem;
    color: #f1f5f9;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

body.light .shadow-control input {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1e293b;
}

.shadow-control input:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: none;
}

.shadow-control input[type="range"] {
    padding: 0;
    height: 6px;
    background: #475569;
    border: none;
}

body.light .shadow-control input[type="range"] {
    background: #d1d5db;
}

.shadow-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shadow-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.shadow-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.shadow-control input[type="range"]::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}


.inset-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #475569;
}

body.light .inset-toggle {
    border-top-color: #e2e8f0;
}

.inset-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.inset-toggle label {
    font-size: 0.75rem;
    color: #94a3b8;
    cursor: pointer;
}

body.light .inset-toggle label {
    color: #64748b;
}

/* Preview Panel */
.preview-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-info {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.copy-preview-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    height: 36px;
}

.copy-preview-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

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

body.light .preview-info {
    color: #64748b;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: #334155;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 2px dashed #475569;
    padding: 20px;
}

body.light .preview-container {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.preview-box {
    width: 200px;
    height: 47px;
    background: #f1f3f6;
    border-radius: 20px;
    border: none;
    color: #827575;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light .preview-box {
    background: #f1f3f6;
    border: none;
    color: #827575;
}

.preview-text {
    pointer-events: none;
}

.preview-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

body.light .preview-controls .control-group {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.preview-controls .control-group:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.preview-controls .control-group label {
    font-size: 0.875rem;
    color: #f1f5f9;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

body.light .preview-controls .control-group label {
    color: #1e293b;
}

.preview-controls .checkbox-group {
    padding: 0.5rem;
    background: #475569;
    border: 1px solid #64748b;
}

body.light .preview-controls .checkbox-group {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.preview-controls .checkbox-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.preview-controls .checkbox-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.preview-controls .checkbox-control label {
    font-size: 0.875rem;
    color: #f1f5f9;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

body.light .preview-controls .checkbox-control label {
    color: #1e293b;
}

.preview-controls .input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.preview-controls .input-group input[type="number"] {
    min-width: 0;
    flex-shrink: 0;
    width: 80px;
    padding: 0.5rem;
    background: #475569;
    border: 1px solid #64748b;
    border-radius: 0.375rem;
    color: #f1f5f9;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

body.light .preview-controls .input-group input[type="number"] {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1e293b;
}

.preview-controls .input-group input[type="range"] {
    flex: 1;
    height: 8px;
    background: #475569;
    border: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

body.light .preview-controls .input-group input[type="range"] {
    background: #d1d5db;
}

.preview-controls .input-group input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preview-controls .input-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.preview-controls .input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preview-controls .input-group input[type="range"]::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.preview-controls .input-group span {
    font-size: 0.875rem;
    color: #94a3b8;
    min-width: 20px;
    font-weight: 500;
}

body.light .preview-controls .input-group span {
    color: #64748b;
}


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

body.light .control-group label {
    color: #1e293b;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group input[type="range"] {
    flex: 1;
    height: 6px;
    background: #475569;
    border: none;
    border-radius: 3px;
}

body.light .input-group input[type="range"] {
    background: #d1d5db;
}

.input-group input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    background: #475569;
    border: 1px solid #64748b;
    border-radius: 0.375rem;
    color: #f1f5f9;
    text-align: center;
    font-size: 0.875rem;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: none;
}

body.light .input-group input[type="number"] {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1e293b;
}

body.light .input-group input[type="number"]:focus {
    outline: none;
    border-color: #d1d5db;
    box-shadow: none;
}

.input-group span {
    font-size: 0.875rem;
    color: #94a3b8;
    min-width: 20px;
}

body.light .input-group span {
    color: #64748b;
}

/* Color Input Groups - Fixed Design */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    background: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body.light .color-input-group input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-input-group input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2);
}

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

.color-code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f1f5f9;
    background: #334155;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #475569;
    flex: 1;
    text-align: center;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

body.light .color-code {
    color: #1e293b;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.color-code:hover {
    background: #475569;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

body.light .color-code:hover {
    background: #e2e8f0;
    border-color: #3b82f6;
}

body.light input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Enhanced Color Input Styling */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 0.375rem;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0.375rem;
    height: 100%;
    width: 100%;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 0.375rem;
    height: 100%;
    width: 100%;
}

/* Color Input Animation Effects */
input[type="color"]::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;
    pointer-events: none;
    border-radius: 0.5rem;
}

input[type="color"]:hover::before {
    opacity: 1;
}

/* Color Input Focus Ring Enhancement */
input[type="color"]: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.2);
}

input[type="color"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Color Input in Preview Controls */
.preview-controls input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    background: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .preview-controls input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-controls input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Color Input in Shadow Controls */
.shadow-control input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    background: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .shadow-control input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-control input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Color Input in Input Groups */
.input-group input[type="color"] {
    width: 60px;
    height: 50px;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    background: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

body.light .input-group input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-group input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Output Panel */
.output-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.output-actions select {
    padding: 0.5rem;
    background: #475569;
    border: 1px solid #64748b;
    border-radius: 0.375rem;
    color: #f1f5f9;
    font-size: 0.875rem;
    cursor: pointer;
}

body.light .output-actions select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1e293b;
}

.copy-btn, .download-btn, .paste-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.copy-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.paste-btn {
    background: #10b981;
    color: white;
}

.paste-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.download-btn {
    background: #10b981;
    color: white;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.code-container {
    margin-bottom: 1.5rem;
}

#code-output {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

body.light #code-output {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

.export-options h3 {
    font-size: 0.875rem;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

body.light .export-options h3 {
    color: #1e293b;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

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

body.light .export-btn {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.export-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

body.light .export-btn:hover {
    background: #e5e7eb;
}

/* Shadow Layer - Fresh Modern Design */
.shadow-layer {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


body.light .shadow-layer {
    background: #ffffff;
    border-color: #e5e7eb;
}



/* Shadow Layer Header - Standard UI */
.shadow-layer-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.shadow-layer-header:hover {
    background-color: rgba(71, 85, 105, 0.1);
}

body.light .shadow-layer-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body.light .shadow-layer-header:hover {
    background-color: rgba(226, 232, 240, 0.5);
}

/* Shadow Layer Title Section */
.shadow-layer-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shadow-color-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadow-color-preview {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
}

.shadow-color-text {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

/* Dark theme for shadow color indicator */
body.dark .shadow-color-preview {
    border-color: #475569;
    background: #1e293b;
}

body.dark .shadow-color-text {
    color: #94a3b8;
}

.shadow-layer-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.025em;
}

body.light .shadow-layer-title {
    color: #1e293b;
}

.shadow-layer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Remove Button - Standard Design */
.remove-shadow {
    background: #ef4444;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-shadow:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.remove-shadow:active {
    transform: translateY(0);
}

.remove-icon {
    width: 14px;
    height: 14px;
}

/* Shadow Collapse Toggle - Redesigned */
.shadow-collapse-toggle {
    /* background: #1e293b; */
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
}

.shadow-collapse-toggle:hover {
    color: #3b82f6;
    /* background: #1e293b; */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.shadow-collapse-toggle:active {
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .shadow-collapse-toggle {
    color: #94a3b8;
}

body.light .shadow-collapse-toggle:hover {
    color: #3b82f6;
    /* background: #1e293b; */
}

.shadow-collapse-toggle.expanded .collapse-icon {
    transform: rotate(180deg);
}

/* Shadow Controls - Clean Design */
.shadow-controls {
    padding: 20px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.shadow-controls.collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
}

body.light .shadow-controls {
    background: #ffffff;
}

.shadow-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
    padding: 0.5rem;
    background: #334155;
    border-radius: 0.5rem;
    border: 1px solid #475569;
    transition: all 0.2s ease;
}

body.light .shadow-control-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.shadow-control-row:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.shadow-control-row:last-child {
    margin-bottom: 0;
}

.shadow-control-row label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f1f5f9;
    min-width: 120px;
    flex-shrink: 0;
}

body.light .shadow-control-row label {
    color: #1e293b;
}

.shadow-control-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* Custom Color Input */
.custom-color-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
    overflow: hidden;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 6px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
    width: 100%;
    height: 100%;
}

.color-preview {
    flex: 1;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.color-value {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* Shadow layer color input styles */
.color-picker {
    border-color: #e2e8f0;
}

.color-preview {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.color-value {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
}

/* Dark theme for shadow layers */
body.dark .color-picker {
    border-color: #475569;
}

body.dark .color-preview {
    border-color: #475569;
    background: #1e293b;
}

body.dark .color-value {
    color: #f1f5f9;
    background: rgba(0, 0, 0, 0.7);
}

.shadow-control-input input[type="range"] {
    flex: 1;
    height: 8px;
    background: #475569;
    border: none;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shadow-control-input input[type="range"]:hover {
    background: #64748b;
}

body.light .shadow-control-input input[type="range"] {
    background: #d1d5db;
}

body.light .shadow-control-input input[type="range"]:hover {
    background: #9ca3af;
}

.shadow-control-input input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-control-input input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.shadow-control-input input[type="color"] {
    width: 50px;
    height: 50px;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    background: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .shadow-control-input input[type="color"] {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-control-input input[type="color"]:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.shadow-control-input input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.value-display,
.color-display,
.checkbox-label {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
    min-width: 70px;
    text-align: right;
    padding: 0.25rem 0.5rem;
    background: #475569;
    border-radius: 0.375rem;
    border: 1px solid #64748b;
    transition: all 0.2s ease;
}

body.light .value-display,
body.light .color-display,
body.light .checkbox-label {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.value-display:hover,
.color-display:hover,
.checkbox-label:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

body.light .value-display,
body.light .color-display,
body.light .checkbox-label {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

body.light .value-display:hover,
body.light .color-display:hover,
body.light .checkbox-label:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.color-display {
    background: #1f2937;
    color: #ffffff;
    border-color: #374151;
}

body.light .color-display {
    background: #1f2937;
    color: #ffffff;
    border-color: #374151;
}

/* Responsive Design */
@media (min-width: 1201px) {
    /* Color input groups for large screens */
    .color-input-group {
        gap: 0.75rem;
        height: 40px;
    }
    
    .color-input-group input[type="color"] {
        width: 30%;
        height: 40px;
    }
    
    .color-code {
        font-size: 0.8rem;
        padding: 0.5rem;
        height: 40px;
    }
}

@media (max-width: 1200px) and (min-width: 1024px) {
    .app-grid {
        grid-template-columns: 280px 1fr;
        gap: 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-controls-panel {
        min-width: 0;
        overflow: hidden;
        max-width: 100%;
    }
    
    .left-column {
        min-width: 0;
        overflow: hidden;
        max-width: 100%;
    }
    
    .preview-controls {
        gap: 0.75rem;
    }
    
    .preview-controls .control-group {
        padding: 0.375rem;
        gap: 0.25rem;
    }
    
    .preview-controls .input-group {
        gap: 0.375rem;
        
    }
    
    .preview-controls .input-group span {
        font-size: 0.7rem;
    }
    
    /* Color input groups optimization for 1024-1200px */
    .color-input-group {
        gap: 0.25rem;
        height: 32px;
    }
    
    .color-input-group input[type="color"] {
        width: 40%;
        height: 32px;
    }
    
    .color-code {
        font-size: 0.7rem;
        padding: 0.25rem;
        height: 32px;
    }
    
    /* Saved shadows specific fixes for 1024-1200px */
    .saved-shadows-panel {
        margin-top: 0.5rem;
        padding: 0.75rem;
        overflow: hidden;
    }
    
    .saved-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
        justify-content: center;
    }
    
    .saved-shadow-item {
        width: 120px;
        flex-shrink: 0;
        margin: 0;
    }
    
    .saved-shadow-preview {
        width: 90px;
        height: 30px;
        font-size: 0.5rem;
        margin: 0 auto 0.3rem auto;
        max-width: calc(100% - 0.6rem);
        box-sizing: border-box;
    }
    
    .saved-shadow-info {
        margin-bottom: 0.3rem;
        text-align: center;
        overflow: hidden;
    }
    
    .saved-shadow-name {
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .saved-shadow-actions {
        display: flex;
        gap: 0.15rem;
        justify-content: center;
        margin-top: 0.3rem;
        flex-wrap: wrap;
    }
    
    .saved-shadow-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.55rem;
        flex: 1;
        min-width: 0;
    }
    
    .saved-shadow-btn svg {
        width: 8px;
        height: 8px;
    }
    
    .saved-shadow-btn.delete-btn {
        width: 22px;
        height: 22px;
        top: 0.1rem;
        right: 0.1rem;
        flex: none;
    }
    
    .saved-shadow-btn.delete-btn svg {
        width: 11px;
        height: 11px;
    }
}

@media (max-width: 1200px) {
    .app-grid {
        grid-template-columns: 300px 1fr;
        gap: 1rem;
    }
    
    .preview-controls-panel {
        min-width: 0;
        overflow: hidden;
    }
    
    .left-column {
        min-width: 0;
        overflow: hidden;
    }
    
    .preview-controls {
        gap: 1rem;
    }
    
    .preview-controls .control-group {
        padding: 0.5rem;
        gap: 0.375rem;
    }
    
    .preview-controls .input-group {
        gap: 0.5rem;
    }
    
    .preview-controls .input-group span {
        font-size: 0.75rem;
    }
    
    /* Color input groups optimization for 1200px */
    .color-input-group {
        gap: 0.375rem;
        height: 36px;
    }
    
    .color-input-group input[type="color"] {
        width: 35%;
        height: 36px;
    }
    
    .color-code {
        font-size: 0.75rem;
        padding: 0.375rem;
        height: 36px;
    }
    
    /* Saved shadows adjustments for 1200px and below */
    .saved-shadows-panel {
        margin-top: 0.75rem;
        padding: 1rem;
        overflow: hidden;
    }
    
    .saved-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 0;
        justify-content: center;
    }
    
    .saved-shadow-item {
        width: 120px;
        flex-shrink: 0;
        margin: 0;
    }
    
    .saved-shadow-preview {
        width: 100px;
        height: 35px;
        font-size: 0.55rem;
        margin: 0 auto 0.4rem auto;
        max-width: calc(100% - 0.8rem);
        box-sizing: border-box;
    }
    
    .saved-shadow-info {
        margin-bottom: 0.4rem;
        text-align: center;
        overflow: hidden;
    }
    
    .saved-shadow-name {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .saved-shadow-actions {
        display: flex;
        gap: 0.2rem;
        justify-content: center;
        margin-top: 0.4rem;
        flex-wrap: wrap;
    }
    
    .saved-shadow-btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.6rem;
        flex: 1;
        min-width: 0;
    }
    
    .saved-shadow-btn svg {
        width: 9px;
        height: 9px;
    }
    
    .saved-shadow-btn.delete-btn {
        width: 24px;
        height: 24px;
        top: 0.15rem;
        right: 0.15rem;
        flex: none;
    }
    
    .saved-shadow-btn.delete-btn svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 1140px) {
    .app-grid {
        grid-template-columns: 280px 1fr;
        gap: 0.75rem;
    }
    
    .preview-controls-panel {
        min-width: 0;
        overflow: hidden;
    }
    
    .preview-controls {
        gap: 0.75rem;
    }
    
    .preview-controls .control-group {
        padding: 0.375rem;
        gap: 0.25rem;
    }
    
    .preview-controls .input-group {
        gap: 0.375rem;
    }
    
    .preview-controls .input-group span {
        font-size: 0.7rem;
    }
    
    /* Color input groups optimization for 1140px */
    .color-input-group {
        gap: 0.25rem;
        height: 32px;
    }
    
    .color-input-group input[type="color"] {
        width: 40%;
        height: 32px;
    }
    
    .color-code {
        font-size: 0.7rem;
        padding: 0.25rem;
        height: 32px;
    }
    
    /* Shadow layer optimization for 1140px */
    .shadow-layer-header {
        padding: 12px 16px;
    }
    
    .shadow-layer-title {
        font-size: 15px;
    }
    
    .remove-shadow {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .collapse-toggle {
        width: 28px;
        height: 28px;
        padding: 0.25rem;
    }
    
    .shadow-collapse-toggle {
        width: 32px;
        height: 32px;
        padding: 0.5rem;
    }
    
    .collapse-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 1034px) {
    .app-grid {
        grid-template-columns: 260px 1fr;
        gap: 0.5rem;
    }
    
    .preview-controls-panel {
        min-width: 0;
        overflow: hidden;
    }
    
    .preview-controls {
        gap: 0.5rem;
    }
    
    .preview-controls .control-group {
        padding: 0.25rem;
        gap: 0.25rem;
    }
    
    .preview-controls .input-group {
        gap: 0.25rem;
    }
    
    .preview-controls .input-group span {
        font-size: 0.65rem;
    }
    
    /* Color input groups optimization for 1034px */
    .color-input-group {
        gap: 0.25rem;
        height: 28px;
    }
    
    .color-input-group input[type="color"] {
        width: 45%;
        height: 28px;
    }
    
    .color-code {
        font-size: 0.65rem;
        padding: 0.25rem;
        height: 28px;
    }
    
    /* Shadow layer optimization for 1034px */
    .shadow-layer-header {
        padding: 10px 12px;
    }
    
    .shadow-layer-title {
        font-size: 14px;
    }
    
    .remove-shadow {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .collapse-toggle {
        width: 24px;
        height: 24px;
        padding: 0.25rem;
    }
    
    .shadow-collapse-toggle {
        width: 28px;
        height: 28px;
        padding: 0.25rem;
    }
    
    .collapse-icon {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 1024px) {
    .app-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .right-panels {
        gap: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-controls {
        grid-template-columns: 1fr;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Reorder panels for smaller screens */
    .left-column {
        order: 2; /* Place after right-panels */
    }
    
    .right-panels {
        order: 1; /* Place first */
    }
    
    /* Saved shadows layout for <=1024px */
    .saved-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem 0;
        justify-content: center;
    }
    
    .saved-shadow-item {
        width: 140px;
        flex-shrink: 0;
        margin: 0;
    }
    
    .saved-shadow-preview {
        width: 120px;
        height: 40px;
        font-size: 0.6rem;
    }
    
    .saved-shadow-name {
        font-size: 0.75rem;
    }
    
    .saved-shadow-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .saved-shadow-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .saved-shadow-btn.delete-btn {
        width: 26px;
        height: 26px;
        top: 0.2rem;
        right: 0.2rem;
    }
    
    .saved-shadow-btn.delete-btn svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .header-content {
        max-width: 100%;
        padding: 0.75rem 1rem;
        flex-direction: row;
        justify-content: space-between;
        overflow-x: hidden;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Ensure header elements don't overflow */
    .logo {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 120px);
    }
    
    .header-nav {
        flex-shrink: 0;
    }
    
    /* Force single column layout on mobile */
    .app-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Reorder panels for mobile */
    .left-column {
        order: 2;
        width: 100%;
        max-width: 100%;
        gap: 1rem;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .right-panels {
        order: 1;
        width: 100%;
        max-width: 100%;
        gap: 1rem;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .logo-image {
        width: 140px;
        height: 36px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    /* Panel improvements for mobile */
    .panel {
        margin: 0;
        padding: 0;
        border-radius: 8px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Preview panel header specific mobile fixes */
    .preview-panel .panel-header {
        padding: 0.75rem 1rem 0.5rem 1rem;
    }
    
    .preview-panel .panel-header h2 {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    .panel-content {
        padding: 0.75rem 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Preview panel mobile fixes */
    .preview-container {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .preview-box {
        max-width: calc(100vw - 4rem);
        word-wrap: break-word;
    }
    
    .reset-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .header-nav {
        gap: 1rem;
    }
    
    .home-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Breadcrumb mobile styles */
    .breadcrumb-nav {
        padding: 0.5rem 0;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        gap: 0.375rem;
    }
    
    .breadcrumb-link {
        gap: 0.25rem;
        padding: 0.2rem 0.4rem;
    }
    
    .breadcrumb-icon {
        width: 12px;
        height: 12px;
    }
    
    .breadcrumb-separator {
        margin: 0 0.15rem;
    }
    
    .breadcrumb-separator svg {
        width: 10px;
        height: 10px;
    }
    
    .breadcrumb-current {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    /* How to Use Section - Mobile */
    .how-to-use-section {
        padding: 2rem 0;
    }
    
    .how-to-use-content {
        padding: 0 1rem;
    }
    
    .how-to-use-content h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .instruction-card {
        padding: 1.5rem;
    }
    
    .instruction-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 1rem;
    }
    
    .instruction-card h3 {
        font-size: 1.125rem;
    }
    
    .tips-section {
        padding: 1.5rem;
    }
    
    .tips-section h3 {
        font-size: 1.25rem;
    }
    
    /* Guide Section - Mobile */
    .guide-content h2 {
        font-size: 1.75rem;
    }
    
    .guide-intro {
        padding: 1.5rem;
    }
    
    .guide-section h3 {
        font-size: 1.5rem;
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .advanced-examples {
        grid-template-columns: 1fr;
    }
    
    .code-block {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .example-preview {
        width: 100px;
        height: 70px;
    }
    
    .shadow-demo-box {
        width: 70px;
        height: 45px;
        font-size: 0.7rem;
    }
    
    .cta-box {
        padding: 1.5rem;
    }
    
    /* FAQ - Mobile */
    .how-to-use-section {
        padding: 2rem 0;
    }
    
    .how-to-use-content {
        padding: 0 1rem;
    }
    
    .how-to-use-content h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-question h3 {
        font-size: 1rem;
    }
    
    .faq-answer p {
        padding: 0 1rem 1rem;
    }
    
    .panel-content {
        padding: 1rem;
    }
    
    .preview-container {
        min-height: 250px;
    }
    
    .output-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    /* Preview controls mobile optimization */
    .preview-controls {
        gap: 0.75rem;
    }
    
    .preview-controls .control-group {
        padding: 0.5rem;
        gap: 0.375rem;
    }
    
    .preview-controls .control-group label {
        font-size: 0.8rem;
    }
    
    .preview-controls .input-group {
        gap: 0.375rem;
    }
    
    .preview-controls .input-group input[type="number"] {
        width: 50px;
        font-size: 0.8rem;
    }
    
    .preview-controls .input-group span {
        font-size: 0.7rem;
    }
    
    .preview-controls .checkbox-control {
        gap: 0.5rem;
    }
    
    .preview-controls .checkbox-control input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .preview-controls .checkbox-control label {
        font-size: 0.8rem;
    }
    
    /* Color input groups mobile optimization */
    .color-input-group {
        gap: 0.375rem;
        height: 32px;
    }
    
    .color-input-group input[type="color"] {
        width: 40%;
        height: 32px;
    }
    
    .color-code {
        font-size: 0.7rem;
        padding: 0.25rem;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .header-content {
        max-width: 100%;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo-image {
        width: 120px;
        height: 30px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .reset-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .header-nav {
        gap: 0.75rem;
    }
    
    .home-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .preview-container {
        min-height: 200px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input[type="number"] {
        width: 100%;
    }
}



.output-panel .panel-header {
    background: #0f172a;
    border-bottom: 1px solid #334155;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.output-panel .panel-header h2 {
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.output-options {
    display: flex;
    align-items: center;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #f1f5f9;
    font-size: 14px;
}

.option-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.checkbox-text {
    user-select: none;
}

.format-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.format-actions select {
    background: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-actions select:hover {
    border-color: #64748b;
}

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

.copy-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

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

/* Light theme for output panel */
body.light .output-panel {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light .output-panel .panel-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body.light .output-panel .panel-header h2 {
    color: #1e293b;
}

body.light .option-label {
    color: #374151;
}

body.light .format-actions select {
    background: #f8fafc;
    color: #374151;
    border-color: #d1d5db;
}

body.light .format-actions select:hover {
    border-color: #9ca3af;
}

body.light .format-actions select:focus {
    border-color: #3b82f6;
}

/* Help Text Styling */
.help-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    line-height: 1.2;
    display: block;
}

body.light .help-text {
    color: #6b7280;
}

/* Save Shadow Button */
.save-shadow-btn {
    background: #1e293b;
    border: none;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.save-shadow-btn:hover {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.save-shadow-btn:active {
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .save-shadow-btn {
    background: #1e293b;
    color: #e2e8f0;
}

body.light .save-shadow-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Recommended Shadows Panel */
.recommended-shadows-panel {
    margin-top: 1rem;
    padding: 0.75rem;
}

.recommended-shadows-info {
    font-size: 0.875rem;
    color: #94a3b8;
}

.recommended-shadows-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    justify-content: center;
}

.recommended-shadow-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.5rem;
    padding-top: 2rem; /* Extra space for delete button */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    width: 140px;
    flex-shrink: 0;
    margin: 0;
    overflow: visible; /* Ensure delete button is not clipped */
}

.recommended-shadow-preview {
    width: 100px;
    height: 40px;
    border-radius: 0.375rem;
    margin: 0 auto 0.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: #374151;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.recommended-shadow-info {
    margin-bottom: 0.5rem;
    text-align: center;
}

.recommended-shadow-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.recommended-shadow-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.recommended-shadow-btn {
    background: #3b82f6;
    border: 1px solid #2563eb;
    color: #ffffff;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex: 1;
    font-weight: 500;
    transition: all 0.2s ease;
}

.recommended-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.recommended-shadow-btn svg {
    width: 12px;
    height: 12px;
}

body.light .recommended-shadow-item {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light .recommended-shadow-preview {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #374151;
}

body.light .recommended-shadow-name {
    color: #374151;
}

body.light .recommended-shadow-btn {
    background: #3b82f6;
    color: #ffffff;
    border-color: #2563eb;
}

body.light .recommended-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Dark theme for recommended shadows */
body.dark .recommended-shadow-item {
    background: #1e293b;
    border-color: #334155;
}

body.dark .recommended-shadow-preview {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .recommended-shadow-name {
    color: #e2e8f0;
}

body.dark .recommended-shadow-btn {
    background: #3b82f6;
    color: #ffffff;
    border-color: #2563eb;
}

body.dark .recommended-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.saved-shadows-info {
    font-size: 0.875rem;
    color: #94a3b8;
}

.saved-shadows-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    justify-content: center;
}

.empty-state {
    width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    text-align: center;
    padding: 1rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.empty-state svg {
    margin-bottom: 0.5rem;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.empty-state p {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.empty-state small {
    font-size: 0.75rem;
    opacity: 0.7;
    line-height: 1.2;
    flex-shrink: 0;
}

/* Saved Shadow Item - Redesigned for Better Visibility */
.saved-shadow-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 0.5rem;
    padding-top: 2rem; /* Extra space for delete button */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    width: 140px;
    flex-shrink: 0;
    margin: 0;
    overflow: visible; /* Ensure delete button is not clipped */
    border: 1px solid #e2e8f0;
}



.saved-shadow-preview {
    width: 100px;
    height: 40px;
    border-radius: 0.375rem;
    margin: 0 auto 0.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: #374151;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.saved-shadow-info {
    margin-bottom: 0.5rem;
    text-align: center;
}

.saved-shadow-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}


.saved-shadow-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.saved-shadow-btn {
    background: #3b82f6;
    border: 1px solid #2563eb;
    color: #ffffff;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex: 1;
    font-weight: 500;
    transition: all 0.2s ease;
}

.saved-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.saved-shadow-btn.delete-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    flex: none;
    z-index: 10;
    background: #ef4444;
    color: #ffffff;
    border: 1px solid #dc2626;
    box-shadow: none;
}

.saved-shadow-btn svg {
    width: 12px;
    height: 12px;
}

.saved-shadow-btn.delete-btn svg {
    width: 14px;
    height: 14px;
}

body.light .saved-shadow-item {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light .saved-shadow-preview {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #374151;
}

body.light .saved-shadow-name {
    color: #374151;
}

body.light .saved-shadow-btn {
    background: #3b82f6;
    color: #ffffff;
    border-color: #2563eb;
}

body.light .saved-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

body.light .saved-shadow-btn.delete-btn {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
}

body.light .saved-shadow-btn.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Dark theme for saved shadows */
body.dark .saved-shadow-item {
    background: #1e293b;
    border-color: #334155;
}

body.dark .saved-shadow-preview {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark .saved-shadow-name {
    color: #e2e8f0;
}

body.dark .saved-shadow-btn {
    background: #3b82f6;
    color: #ffffff;
    border-color: #2563eb;
}

body.dark .saved-shadow-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

body.dark .saved-shadow-btn.delete-btn {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
}

body.dark .saved-shadow-btn.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}


@media (max-width: 768px) {
    .saved-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 0;
        justify-content: center;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .saved-shadow-item {
        width: 160px;
        max-width: 160px;
        overflow-x: hidden;
        flex-shrink: 0;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .saved-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
        justify-content: center;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .saved-shadow-item {
        width: 140px;
        max-width: 140px;
        overflow-x: hidden;
        flex-shrink: 0;
        margin: 0;
    }
    
    .saved-shadow-preview {
        width: 100px;
        height: 35px;
        font-size: 0.55rem;
    }
    
    .saved-shadow-name {
        font-size: 0.7rem;
    }
    
    
    .saved-shadow-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .saved-shadow-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .saved-shadow-btn.delete-btn {
        width: 24px;
        height: 24px;
        top: 0.2rem;
        right: 0.2rem;
    }
    
    .saved-shadow-btn.delete-btn svg {
        width: 12px;
        height: 12px;
    }
    
    /* Mobile-specific preview controls fixes for 480px */
    .preview-controls {
        gap: 0.5rem;
        padding: 0.25rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-controls .control-group {
        padding: 0.5rem;
        gap: 0.375rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-controls .control-group label {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .preview-controls .input-group {
        gap: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
         display: flex;
        flex-direction: row;
    }
    
    .preview-controls .input-group input[type="number"] {
        width: 60px;
        padding: 0.25rem;
        font-size: 0.75rem;
        max-width: 60px;
    }
    
    .preview-controls .input-group input[type="range"] {
        max-width: 100%;
    }
    
    .preview-controls .input-group span {
        font-size: 0.7rem;
        min-width: 15px;
        max-width: 20px;
    }
    
    /* Mobile-specific color input group fixes for 480px */
    .color-input-group {
        gap: 0.5rem;
        height: 40px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .color-input-group input[type="color"] {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .color-code {
        font-size: 0.7rem;
        padding: 0.25rem;
        height: 40px;
        min-width: 80px;
        max-width: 100px;
    }
    
    /* Mobile-specific shadow control fixes for 480px */
    .shadow-control-row {
        padding: 0.25rem;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control-row label {
        font-size: 0.7rem;
        min-width: 80px;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shadow-control-input {
        gap: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control-input input[type="range"] {
        max-width: 100%;
    }
    
    .value-display,
    .color-display,
    .checkbox-label {
        font-size: 0.7rem;
        min-width: 50px;
        max-width: 60px;
        padding: 0.2rem 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shadow-control-input input[type="color"] {
        width: 35px;
        height: 35px;
        min-width: 35px;
        max-width: 35px;
    }
    
    .shadow-control-input input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

textarea:focus {
    outline: none;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Responsive styles for recommended shadows */
@media (max-width: 1200px) and (min-width: 1024px) {
    .recommended-shadows-panel {
        margin-top: 0.5rem;
        padding: 0.75rem;
        overflow: hidden;
    }
    
    .recommended-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
        justify-content: center;
    }
    
    .recommended-shadow-item {
        width: 120px;
        flex-shrink: 0;
        margin: 0;
        padding: 0.3rem;
        padding-top: 1.4rem;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .recommended-shadow-preview {
        width: 90px;
        height: 30px;
        font-size: 0.5rem;
        margin: 0 auto 0.3rem auto;
        max-width: calc(100% - 0.6rem);
        box-sizing: border-box;
    }
    
    .recommended-shadow-name {
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .recommended-shadow-actions {
        gap: 0.15rem;
        margin-top: 0.3rem;
    }
    
    .recommended-shadow-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.55rem;
        flex: 1;
        min-width: 0;
    }
    
    .recommended-shadow-btn svg {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 1024px) {
    .recommended-shadows-container {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem 0;
        justify-content: center;
    }
    
    .recommended-shadow-item {
        width: 140px;
        flex-shrink: 0;
        margin: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .recommended-shadow-preview {
        width: 100px;
        height: 40px;
        font-size: 0.6rem;
        margin: 0 auto 0.5rem auto;
        max-width: calc(100% - 1rem);
        box-sizing: border-box;
    }
    
    .recommended-shadow-name {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .recommended-shadow-actions {
        gap: 0.25rem;
        margin-top: 0.5rem;
    }
    
    .recommended-shadow-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        flex: 1;
        min-width: 0;
    }
    
    .recommended-shadow-btn svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 768px) {
    .recommended-shadows-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
        justify-items: center;
    }
    
    .recommended-shadow-item {
        width: 100%;
        max-width: 160px;
        min-width: 140px;
        overflow-x: hidden;
        padding: 0.75rem;
        padding-top: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .recommended-shadow-preview {
        width: 100px;
        height: 50px;
        font-size: 0.7rem;
        margin: 0 auto 0.75rem auto;
        border-radius: 8px;
    }
    
    .recommended-shadow-name {
        font-size: 0.8rem;
        font-weight: 600;
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .recommended-shadow-actions {
        gap: 0.5rem;
        margin-top: 0.75rem;
        justify-content: center;
    }
    
    .recommended-shadow-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
        border-radius: 6px;
        min-width: 60px;
    }
    
    .recommended-shadow-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* Mobile responsive for 411px width */
@media (max-width: 411px) {
    html, body {
        height: auto;
        min-height: auto;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100vw;
    }
    
    * {
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .header {
        position: relative;
        padding: 0.5rem 0.5rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .header-content {
        padding: 0;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
    
    .main {
        padding: 0.25rem 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 0.25rem;
        max-width: 100%;
        margin: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0;
        margin: 0;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .left-column {
        order: 2;
        width: 100%;
        max-width: 100%;
        gap: 0.25rem;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .right-panels {
        order: 1;
        gap: 0.25rem;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Header adjustments */
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        padding: 0;
    }
    
    .logo-image {
        width: 32px;
        height: 32px;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    
    /* Panel adjustments */
    .panel {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
        min-height: auto;
        height: auto;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .panel-header {
        padding: 0.25rem;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .panel-header h2 {
        font-size: 0.8rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .panel-content {
        padding: 0.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Shadow controls */
    .shadow-controls {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control {
        gap: 0.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control label {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shadow-control input[type="range"] {
        width: 100%;
        max-width: 100%;
    }
    
    .shadow-control input[type="number"] {
        width: 50px;
        padding: 0.2rem;
        font-size: 0.7rem;
        max-width: 50px;
    }
    
    .shadow-control input[type="color"] {
        width: 28px;
        height: 28px;
        max-width: 28px;
    }
    
    /* Preview panel */
    .preview-panel {
        min-height: auto;
        height: auto;
        padding: 0.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-container {
        padding: 0.5rem;
        min-height: 80px;
        height: auto;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-box {
        max-width: 100%;
        width: 150px;
        height: 35px;
    }
    
    .preview-header-actions {
        flex-direction: column;
        gap: 0.25rem;
        align-items: stretch;
        margin-bottom: 0.25rem;
        width: 100%;
        max-width: 100%;
    }
    
    .preview-header-actions button {
        padding: 0.25rem;
        font-size: 0.7rem;
        flex: 1;
        width: 100%;
        max-width: 100%;
    }
    
    /* Preview controls */
    .preview-controls-content {
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-control-group {
        gap: 0.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-control-group label {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .preview-control-group input {
        padding: 0.2rem;
        font-size: 0.7rem;
        max-width: 100%;
    }
    
    .preview-control-group input[type="color"] {
        width: 28px;
        height: 28px;
        max-width: 28px;
    }
    
    /* Output panel */
    .output-panel {
        min-height: auto;
        height: auto;
        padding: 0.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .output-actions {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.25rem;
        width: 100%;
        max-width: 100%;
    }
    
    .output-actions button {
        padding: 0.25rem;
        font-size: 0.7rem;
        flex: 1;
        width: 100%;
        max-width: 100%;
    }
    
    .output-actions select {
        padding: 0.25rem;
        font-size: 0.7rem;
        width: 100%;
        max-width: 100%;
    }
    
    #code-output {
        font-size: 0.7rem;
        padding: 0.25rem;
        min-height: 60px;
        height: auto;
        resize: vertical;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Saved shadows */
    .saved-shadows-container {
        gap: 0.25rem;
        padding: 0.25rem 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .saved-shadow-item {
        width: 75px;
        padding: 0.15rem;
        padding-top: 0.8rem;
        max-width: 75px;
        overflow-x: hidden;
    }
    
    .saved-shadow-preview {
        width: 45px;
        height: 18px;
        font-size: 0.35rem;
        margin: 0 auto 0.15rem auto;
        max-width: 45px;
    }
    
    .saved-shadow-name {
        font-size: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .saved-shadow-actions {
        gap: 0.05rem;
        margin-top: 0.15rem;
        width: 100%;
        max-width: 100%;
    }
    
    .saved-shadow-btn {
        padding: 0.1rem 0.1rem;
        font-size: 0.45rem;
        max-width: 100%;
    }
    
    .saved-shadow-btn svg {
        width: 5px;
        height: 5px;
    }
    
    .saved-shadow-btn.delete-btn {
        width: 14px;
        height: 14px;
        top: 0.05rem;
        right: 0.05rem;
    }
    
    .saved-shadow-btn.delete-btn svg {
        width: 7px;
        height: 7px;
    }
    
    /* Recommended shadows */
    .recommended-shadows-container {
        gap: 0.25rem;
        padding: 0.25rem 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .recommended-shadow-item {
        width: 75px;
        padding: 0.15rem;
        padding-top: 0.8rem;
        max-width: 75px;
        overflow-x: hidden;
    }
    
    .recommended-shadow-preview {
        width: 45px;
        height: 18px;
        font-size: 0.35rem;
        margin: 0 auto 0.15rem auto;
        max-width: 45px;
    }
    
    .recommended-shadow-name {
        font-size: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .recommended-shadow-actions {
        gap: 0.05rem;
        margin-top: 0.15rem;
        width: 100%;
        max-width: 100%;
    }
    
    .recommended-shadow-btn {
        padding: 0.1rem 0.1rem;
        font-size: 0.45rem;
        max-width: 100%;
    }
    
    .recommended-shadow-btn svg {
        width: 5px;
        height: 5px;
    }
    
    /* Shadow layer adjustments */
    .shadow-layer {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
    }
    
    .shadow-layer-header {
        padding: 0.25rem 0;
    }
    
    .shadow-layer-title-section h3 {
        font-size: 0.75rem;
        margin: 0;
    }
    
    .shadow-layer-controls {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .shadow-layer-control {
        gap: 0.15rem;
    }
    
    .shadow-layer-control label {
        font-size: 0.65rem;
    }
    
    .shadow-layer-control input {
        padding: 0.15rem;
        font-size: 0.65rem;
    }
    
    .shadow-layer-control input[type="color"] {
        width: 24px;
        height: 24px;
    }
    
    /* Collapse toggles */
    .collapse-toggle, .shadow-collapse-toggle {
        padding: 0.15rem;
        font-size: 0.65rem;
    }
    
    /* Info displays */
    .preview-info {
        font-size: 0.65rem;
        gap: 0.25rem;
    }
    
    .saved-shadows-info, .recommended-shadows-info {
        font-size: 0.65rem;
    }
    
    /* Prevent overflow from any child elements */
    * {
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .shadow-layer {
        overflow: hidden;
    }
    
    .shadow-layer-controls {
        overflow: hidden;
    }
    
    .preview-controls-content {
        overflow: hidden;
    }
    
    .preview-control-group {
        overflow: hidden;
    }
    
    /* Mobile-specific preview controls fixes */
    .preview-controls {
        gap: 0.5rem;
        padding: 0.25rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-controls .control-group {
        padding: 0.5rem;
        gap: 0.375rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .preview-controls .control-group label {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .preview-controls .input-group {
        gap: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
        display: flex;
        flex-direction: row;
    }
    
    .preview-controls .input-group input[type="number"] {
        width: 60px;
        padding: 0.25rem;
        font-size: 0.75rem;
        max-width: 60px;
    }
    
    .preview-controls .input-group input[type="range"] {
        max-width: 100%;
    }
    
    .preview-controls .input-group span {
        font-size: 0.7rem;
        min-width: 15px;
        max-width: 20px;
    }
    
    /* Mobile-specific color input group fixes */
    .color-input-group {
        gap: 0.5rem;
        height: 40px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .color-input-group input[type="color"] {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .color-code {
        font-size: 0.7rem;
        padding: 0.25rem;
        height: 40px;
        min-width: 80px;
        max-width: 100px;
    }
    
    /* Mobile-specific shadow control fixes */
    .shadow-control-row {
        padding: 0.25rem;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control-row label {
        font-size: 0.7rem;
        min-width: 80px;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shadow-control-input {
        gap: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .shadow-control-input input[type="range"] {
        max-width: 100%;
    }
    
    .value-display,
    .color-display,
    .checkbox-label {
        font-size: 0.7rem;
        min-width: 50px;
        max-width: 60px;
        padding: 0.2rem 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shadow-control-input input[type="color"] {
        width: 35px;
        height: 35px;
        min-width: 35px;
        max-width: 35px;
    }
    
    .shadow-control-input input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    /* Ensure no element exceeds viewport width */
    .panel, .panel-header, .panel-content,
    .shadow-layer, .shadow-layer-header,
    .preview-container, .preview-box,
    .output-panel, #code-output {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top svg {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
}

/* Small mobile devices and tablets in portrait */
@media (max-width: 900px) {
    /* Ensure single column layout */
    .app-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Reorder for mobile: preview first, then controls */
    .right-panels {
        order: 1;
    }
    
    .left-column {
        order: 2;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        min-height: 60px;
    }
    
    .logo-image {
        width: 100px;
        height: 26px;
    }
    
    .logo-text h1 {
        font-size: 0.9rem;
    }
    
    .reset-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        margin-left: auto;
    }
    
    /* Ensure logo and reset button don't overlap */
    .logo {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 100px);
    }
    
    .header-nav {
        flex-shrink: 0;
        max-width: 100px;
    }
    
    .panel-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Preview panel header ultra compact */
    .preview-panel .panel-header {
        display: flex;
        flex-direction: column;
        padding: 0.5rem 0.75rem 0.25rem 0.75rem;
    }
    
    .preview-panel .panel-header h2 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        order: 1;
    }
    
    .panel-content {
        padding: 0.5rem 0.75rem;
    }
    
    /* Ultra compact breadcrumb for small screens */
    .breadcrumb-nav {
        padding: 0.4rem 0;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .breadcrumb-link {
        gap: 0.2rem;
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .breadcrumb-icon {
        width: 11px;
        height: 11px;
    }
    
    .breadcrumb-separator {
        margin: 0 0.1rem;
    }
    
    .breadcrumb-separator svg {
        width: 9px;
        height: 9px;
    }
    
    .breadcrumb-current {
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .preview-container {
        padding: 0.75rem;
    }
    
    .preview-box {
        max-width: calc(100vw - 3rem);
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    /* Ultra compact preview header for small screens */
    .preview-header-actions {
        order: 2;
        gap: 0.4rem;
        flex-direction: column;
    }
    
    .preview-info {
        font-size: 0.65rem;
        gap: 0.5rem;
        margin-bottom: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        order: 1;
    }
    
    .preview-info span {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
        border-radius: 3px;
        background: rgba(100, 116, 139, 0.1);
    }
    
    .save-shadow-btn,
    .copy-preview-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
        min-width: 0;
        flex: 1;
        order: 2;
    }
    
    /* Button container for side-by-side layout */
    .preview-header-actions {
        display: flex;
        flex-wrap: wrap;
    }
    
    .preview-header-actions .preview-info {
        width: 100%;
    }
    
    .save-shadow-btn,
    .copy-preview-btn {
        width: calc(50% - 0.2rem);
    }
    
    /* Recommended shadows for small screens */
    .recommended-shadows-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0.6rem;
        max-width: 100%;
        overflow-x: hidden;
        justify-items: center;
    }
    
    .recommended-shadow-item {
        width: 100%;
        max-width: 140px;
        min-width: 120px;
        padding: 0.6rem;
        padding-top: 0.8rem;
        display: block;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .recommended-shadow-preview {
        width: 90px;
        height: 40px;
        font-size: 0.65rem;
        margin: 0 auto 0.6rem auto;
        border-radius: 6px;
    }
    
    .recommended-shadow-name {
        font-size: 0.75rem;
        font-weight: 600;
        margin-bottom: 0.6rem;
        text-align: center;
    }
    
    .recommended-shadow-actions {
        gap: 0.4rem;
        margin-top: 0.6rem;
        justify-content: center;
        display: flex;
    }
    
    .recommended-shadow-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        border-radius: 5px;
        min-width: 45px;
        flex: 1;
    }
    
    .recommended-shadow-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .main {
        padding: 0.75rem 0;
    }
}

/* Mobile Back to Top */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .back-to-top svg {
        width: 14px;
        height: 14px;
    }
    
    .internal-nav {
        display: none;
    }
    
    .header-nav {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    /* Reset button mobile specific fixes */
    .reset-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
    }
    
    /* Main section mobile spacing */
    .main {
        padding: 1rem 0;
        margin-top: 0;
    }
    
    /* Ensure proper spacing from fixed header */
    body {
        padding-top: 0;
    }
    
    /* Fix preview panel header for mobile */
    .preview-panel .panel-header {
        display: flex;
        flex-direction: column;
        padding: 0.75rem 1rem 0.5rem 1rem;
    }
    
    .preview-panel .panel-header h2 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        order: 1;
    }
    
    .preview-header-actions {
        order: 2;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .preview-info {
        justify-content: center;
        margin-bottom: 0.5rem;
        font-size: 0.7rem;
        gap: 0.75rem;
    }
    
    .preview-info span {
        background: rgba(100, 116, 139, 0.1);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.65rem;
    }
    
    .save-shadow-btn,
    .copy-preview-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 0;
    }
    
    /* Arrange buttons in a row */
    .preview-header-actions .preview-info {
        order: 1;
    }
    
    .preview-header-actions button {
        order: 2;
    }
    
    .save-shadow-btn {
        margin-right: 0.25rem;
    }
    
    .copy-preview-btn {
        margin-left: 0.25rem;
    }
    
    /* Output panel mobile improvements */
    .output-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .format-actions {
        gap: 0.5rem;
        justify-content: space-between;
    }
    
    #output-format {
        flex: 1;
        max-width: 120px;
    }
}

/* Smooth scrolling for internal links */
html {
    scroll-behavior: smooth;
}

/* Focus styles for internal links */
a[href^="#"]:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .back-to-top {
        transition: none;
    }
}