/* UI Design Editor Styles */

.design-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.design-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.design-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.color-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.color-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-group input[type="text"] {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.color-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Typography Grid */
.typography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Effects Grid */
.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

/* Visibility Grid */
.visibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.checkbox-label:hover {
    background-color: #f8f9ff;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkbox-label span {
    font-weight: 500;
    color: #555;
}

/* CSS Editor */
.css-editor {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.css-editor textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
    transition: border-color 0.3s ease;
}

.css-editor textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.css-actions {
    display: flex;
    gap: 10px;
}

/* Theme Presets */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.preset-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preset-preview {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.preset-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
}

.default-theme::before {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.dark-theme::before {
    background: linear-gradient(135deg, #4a5568, #2d3748);
}

.minimal-theme::before {
    background: linear-gradient(135deg, #000000, #666666);
}

.colorful-theme::before {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
}

.professional-theme::before {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.creative-theme::before {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
}

.preset-card span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    text-align: center;
}

/* Button Styles */
.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .color-grid,
    .typography-grid,
    .button-grid,
    .layout-grid,
    .effects-grid {
        grid-template-columns: 1fr;
    }
    
    .visibility-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .design-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .css-actions {
        flex-direction: column;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .design-section {
    background: #2d3748;
    border-color: #4a5568;
    color: #ffffff;
}

[data-theme="dark"] .design-section h3 {
    color: #ffffff;
}

[data-theme="dark"] .color-group label,
[data-theme="dark"] .form-group label,
[data-theme="dark"] .checkbox-label span {
    color: #e2e8f0;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .color-group input[type="text"] {
    background: #4a5568;
    border-color: #718096;
    color: #ffffff;
}

[data-theme="dark"] .form-group input::placeholder {
    color: #a0aec0;
}

[data-theme="dark"] .css-editor textarea {
    background: #4a5568;
    border-color: #718096;
    color: #ffffff;
}

[data-theme="dark"] .css-editor textarea:focus {
    background: #4a5568;
    border-color: #90cdf4;
}

[data-theme="dark"] .checkbox-label:hover {
    background-color: #4a5568;
}

[data-theme="dark"] .preset-card {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .preset-card:hover {
    border-color: #90cdf4;
}

[data-theme="dark"] .preset-card span {
    color: #e2e8f0;
}

/* Animation for smooth transitions */
.design-section {
    animation: slideInUp 0.3s ease-out;
}

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

/* Loading state */
.design-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.design-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Advanced UI Design Styles */

/* Animation Grid */
.animation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Page Tabs */
.page-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.page-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.page-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.page-tab:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Page Settings */
.page-settings {
    position: relative;
}

.page-setting {
    display: none;
}

.page-setting.active {
    display: block;
}

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

/* Responsive Tabs */
.responsive-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
}

.responsive-tab {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.responsive-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.responsive-tab.active:hover {
    color: white;
}

/* Responsive Settings */
.responsive-settings {
    position: relative;
}

.responsive-setting {
    display: none;
}

.responsive-setting.active {
    display: block;
}

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

/* Typography Advanced Grid */
.typography-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Interactive Grid */
.interactive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Layout Advanced Grid */
.layout-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Export Import Actions */
.export-import-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Code Modal */
.code-modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.code-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.code-body {
    padding: 25px;
}

.code-body textarea {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.code-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Enhanced Form Controls */
.form-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Color Palette Display */
.color-palette {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.color-swatch.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Advanced Toggle Switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Preview Window */
.design-preview-window {
    position: fixed;
    top: 50px;
    right: 50px;
    width: 300px;
    height: 200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    border: 3px solid #667eea;
}

.preview-header {
    background: #667eea;
    color: white;
    padding: 10px 15px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-content {
    padding: 15px;
    height: calc(100% - 50px);
    overflow-y: auto;
}

/* Gradient Builder */
.gradient-builder {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
}

.gradient-preview {
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.gradient-stops {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gradient-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.gradient-stop input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.gradient-stop input[type="range"] {
    width: 60px;
}

/* Dark Mode Enhancements */
[data-theme="dark"] .page-tab {
    color: #e2e8f0;
}

[data-theme="dark"] .page-tab.active {
    color: #90cdf4;
    border-bottom-color: #90cdf4;
    background: rgba(144, 205, 244, 0.1);
}

[data-theme="dark"] .responsive-tab {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

[data-theme="dark"] .responsive-tab.active {
    background: #90cdf4;
    color: #1a202c;
    border-color: #90cdf4;
}

[data-theme="dark"] .code-modal-content {
    background: #2d3748;
}

[data-theme="dark"] .code-header {
    background: #4a5568;
    border-bottom-color: #718096;
}

[data-theme="dark"] .code-header h3 {
    color: #ffffff;
}

[data-theme="dark"] .code-body textarea {
    background: #4a5568;
    border-color: #718096;
    color: #ffffff;
}

[data-theme="dark"] .gradient-builder {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .gradient-preview {
    border-color: #718096;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .animation-grid,
    .settings-grid,
    .responsive-grid,
    .typography-advanced-grid,
    .interactive-grid,
    .layout-advanced-grid {
        grid-template-columns: 1fr;
    }
    
    .page-tabs {
        flex-wrap: wrap;
    }
    
    .responsive-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-import-actions {
        flex-direction: column;
    }
    
    .code-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .code-body textarea {
        height: 250px;
    }
    
    .design-preview-window {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 20px;
    }
}