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

:root {
    --coral: #E8614D;
    --coral-light: #FF8B73;
    --coral-dark: #C84A38;
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --text: #2D2D2D;
    --text-light: #6B6B6B;
    --border: #E5E5E5;
    --success: #4CAF50;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Generator Section */
.generator-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 12px var(--shadow);
}

.color-input-container label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

#baseColor {
    width: 80px;
    height: 60px;
    border: 3px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#baseColor:hover {
    transform: scale(1.05);
    border-color: var(--coral);
}

#hexInput {
    flex: 1;
    min-width: 140px;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    font-family: 'Monaco', 'Courier New', monospace;
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

#hexInput:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 97, 77, 0.1);
}

.btn-primary {
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(232, 97, 77, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 97, 77, 0.4);
}

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

/* Palettes Section */
.palettes-section {
    margin-bottom: 3rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.palette-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.palette-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

.palette-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
}

.color-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-swatch {
    flex: 1;
    min-width: 70px;
    height: 80px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.color-swatch::after {
    content: attr(data-hex);
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Courier New', monospace;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

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

/* Preview Section */
.preview-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px var(--shadow);
}

.preview-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.preview-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

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

.preview-card {
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s ease;
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

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

.card-header h3 {
    font-size: 1.4rem;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.preview-card p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

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

.btn-preview-primary,
.btn-preview-secondary {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-preview-primary {
    flex: 1;
}

.btn-preview-secondary {
    flex: 1;
}

/* Footer */
footer {
    background: var(--text);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .generator-section {
        padding: 1.5rem;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #baseColor {
        width: 100%;
        height: 60px;
    }

    .btn-primary {
        width: 100%;
    }

    .palette-grid {
        grid-template-columns: 1fr;
    }

    .preview-section {
        padding: 1.5rem;
    }

    .preview-section h2 {
        font-size: 1.6rem;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

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

    .btn-preview-primary,
    .btn-preview-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 2rem 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .color-swatch {
        min-width: 60px;
        height: 70px;
    }
}
