/* CSS Gradient Generator Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #8B5CF6;
    --accent-secondary: #EC4899;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
main {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Type Selector */
.type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.type-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.type-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.type-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Preview Panel */
.preview-panel {
    margin-bottom: 1.5rem;
}

.gradient-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

/* Controls Panel */
.controls-panel {
    margin-bottom: 1.5rem;
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group.hidden {
    display: none;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Direction Grid */
.direction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 150px;
    margin-bottom: 1rem;
}

.dir-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dir-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.dir-btn:hover:not(.active) {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

/* Angle Input */
.angle-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.angle-input input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.angle-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.angle-input input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.angle-input span {
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 50px;
    text-align: right;
}

/* Shape & Position Buttons */
.shape-btns,
.position-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.shape-btn,
.pos-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.shape-btn.active,
.pos-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.shape-btn:hover:not(.active),
.pos-btn:hover:not(.active) {
    border-color: var(--accent-primary);
}

/* Color Stops */
.color-stops {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-stop {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.color-stop input[type="color"] {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.color-stop input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-stop input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

.color-stop input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
}

.color-stop input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

.color-stop .position-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 35px;
}

.color-stop .remove-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.color-stop .remove-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

[data-theme="dark"] .color-stop .remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.add-color-btn {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.add-color-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Gradient Bar */
.gradient-bar-container {
    margin-top: 1rem;
}

.gradient-bar {
    height: 24px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    box-shadow: var(--shadow-sm);
}

/* Output Panel */
.output-panel {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.output-header label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.copy-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.copy-btn.copied {
    background: #10b981;
}

.css-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* Presets Panel */
.presets-panel {
    margin-top: 1rem;
}

.presets-panel label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.preset-btn {
    height: 50px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.preset-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle .sun {
    display: block;
}

.theme-toggle .moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: block;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.faq-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-item code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .trust-badges {
        gap: 0.5rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .type-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .gradient-preview {
        height: 150px;
    }
    
    .color-stop {
        flex-wrap: wrap;
    }
    
    .color-stop input[type="color"] {
        width: 40px;
        height: 40px;
    }
    
    .presets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .preset-btn {
        height: 40px;
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}
