/* Color Palette Generator Specific Styles */

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    background: #667eea;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.feature-item h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

/* Color Input Section */
.color-input-section {
    padding: 3rem;
    border-top: 1px solid #e2e8f0;
}

.input-methods {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    color: #64748b;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Input Tabs */
.input-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.input-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

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

.input-tab svg {
    flex-shrink: 0;
}

/* Input Content */
.input-content {
    display: none;
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

.input-content.active {
    display: block;
}

/* Manual Color Input */
.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.color-picker-container {
    width: 100%;
    max-width: 600px;
}

.color-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

.color-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Color Picker */
#colorPicker {
    width: 120px;
    height: 120px;
    border: 4px solid #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#colorPicker:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

/* Color Code Inputs */
.color-code-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.code-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.code-input label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.code-input input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', monospace;
    text-align: center;
    width: 150px;
    transition: border-color 0.2s ease;
}

.code-input input:focus {
    outline: none;
    border-color: #667eea;
}

/* Scheme Selector */
.scheme-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scheme-label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

#colorScheme {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#colorScheme:focus {
    outline: none;
    border-color: #667eea;
}

/* Generate Button */
#generatePaletteBtn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Image Upload Section */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f1f5f9;
}

.image-upload-area.dragover {
    border-color: #667eea;
    background: #e0e7ff;
}

.image-upload-area svg {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.image-upload-area h3 {
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.image-upload-area p {
    color: #64748b;
    margin: 0;
}

.file-info {
    font-size: 0.9rem !important;
    color: #94a3b8 !important;
    margin-top: 0.5rem !important;
}

/* Image Preview Section */
.image-preview-section {
    margin-top: 2rem;
}

.image-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

#imageCanvas {
    display: block;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

.color-picker-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 2px #000, 0 2px 8px rgba(0,0,0,0.3);
    display: none;
}

.picked-color-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    gap: 2rem;
}

.picked-color-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.picked-color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.picked-color-codes {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.picked-color-codes span {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: #374151;
}

/* Palette Display Section */
.palette-section {
    padding: 3rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

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

.palette-actions {
    display: flex;
    gap: 1rem;
}

.palette-actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
}

/* Palette Display */
.palette-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.color-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.color-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.color-swatch {
    height: 120px;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.color-swatch::after {
    content: 'Click to edit';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-swatch:hover::after {
    opacity: 1;
}

.color-info {
    padding: 1.5rem;
}

.color-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.color-codes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.85rem;
}

.code-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.code-value:hover {
    background-color: #f1f5f9;
}

/* Export Section */
.export-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

.export-title {
    color: #1e293b;
    font-size: 1.4rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.export-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.export-actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.875rem 1.5rem;
}

/* How It Works Section */
.how-it-works-section {
    padding: 4rem 0;
    background: white;
}

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

.step-item {
    text-align: center;
    padding: 2rem;
}

.step-icon {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #667eea;
}

.step-title {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.step-description {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #667eea;
}

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

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

.faq-question svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

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

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

.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;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #059669;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .color-input-section,
    .palette-section,
    .how-it-works-section,
    .faq-section {
        padding: 2rem 1.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .input-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .input-tab {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .color-code-inputs {
        flex-direction: column;
        align-items: center;
    }
    
    .palette-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .palette-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .palette-display {
        grid-template-columns: 1fr;
    }
    
    .picked-color-info {
        flex-direction: column;
        text-align: center;
    }
    
    .export-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .export-actions button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .color-input-section,
    .palette-section,
    .how-it-works-section,
    .faq-section {
        padding: 1.5rem 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .input-content {
        padding: 1.5rem;
    }
    
    #colorPicker {
        width: 100px;
        height: 100px;
    }
    
    .code-input input {
        width: 120px;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .color-info {
        padding: 1rem;
    }
    
    .color-swatch {
        height: 100px;
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
    }
    
    .step-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    color: inherit;
}

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

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .color-item,
    .input-tab,
    .faq-question svg,
    .toast {
        transition: none;
    }
    
    @keyframes slideInUp,
    @keyframes spin {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}