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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #2d3748;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 32px;
    width: auto;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}


/* Progress Bar */
.progress-container {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 4px;
    background: #e2e8f0;
    z-index: 999;
}

.progress-bar {
    height: 100%;
    background: #e2e8f0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #141559, #48bb78);
    width: 11.11%;
    transition: width 0.3s ease;
}

/* Screen Layout */
.screen {
    display: none;
    min-height: 100vh;
    padding: 80px 20px 120px;
    max-width: 768px;
    margin: 0 auto;
}

.screen.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

.content {
    text-align: center;
}

/* Typography */
.headline {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 16px;
    line-height: 1.2;
}

.subtext {
    font-size: 16px;
    color: #718096;
    margin-bottom: 32px;
    line-height: 1.5;
}

.helper-text {
    font-size: 14px;
    color: #a0aec0;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.helper-text::before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.style-tile {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.style-tile:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.style-tile.selected {
    border-color: #48bb78;
    background: #f0fff4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.15);
}

.style-tile.selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.style-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.style-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

/* Color Selection */
.color-selection {
    margin-bottom: 32px;
}

.selected-count {
    font-size: 14px;
    color: #718096;
    margin-bottom: 16px;
    font-weight: 500;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.color-category {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-category:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.color-category.selected {
    border-color: #48bb78;
    background: #f0fff4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.15);
}

.color-category.selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.color-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.color-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.custom-color-section {
    margin-top: 24px;
}

.custom-color-input {
    margin-top: 24px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    text-align: left;
    transition: all 0.2s ease;
}

.custom-color-input:hover {
    border-color: #cbd5e0;
    background: #f1f5f9;
}

.custom-color-input label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
    letter-spacing: 0.025em;
}

.custom-color-input textarea {
    width: 100%;
    min-height: 140px;
    max-width: 100%;
    resize: vertical;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.6;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-color-input textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.1);
    transform: translateY(-1px);
}

.custom-color-input textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Form Elements */
.input-group {
    margin-bottom: 32px;
    text-align: left;
}

.text-input, .text-area {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 56px;
}

.text-area {
    min-height: 120px;
    font-family: inherit;
}

.text-input:focus, .text-area:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.text-input::placeholder, .text-area::placeholder {
    color: #a0aec0;
    font-style: italic;
    opacity: 0.8;
}

/* Emotion Grid */
.emotion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.emotion-btn {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.emotion-btn:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.emotion-btn.selected {
    border-color: #48bb78;
    background: #f0fff4;
    color: #22543d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.15);
}

/* Choice Buttons */
.choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.choice-btn {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-btn:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.choice-btn.selected {
    border-color: #48bb78;
    background: #f0fff4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.15);
}

.choice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.choice-icon {
    font-size: 32px;
}

.choice-btn span {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

/* Review Table */
.review-table {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 0 auto 40px auto;
    max-width: 800px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.review-header {
    display: none;
}

.review-row {
    display: grid;
    grid-template-columns: 180px 1fr 50px;
    align-items: start;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 70px;
    gap: 32px;
    justify-content: start;
}

.review-row:hover {
    background: #f8fafc;
}

.review-row:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
    text-align: left;
    padding-left: 8px;
    padding-top: 2px;
    line-height: 1.4;
}

.review-value {
    color: #4a5568;
    font-size: 15px;
    display: block;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    padding-top: 2px;
}

.review-action {
    display: flex;
    justify-content: center;
    align-items: center;
}

.review-style-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: -2px;
}

.review-style-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.review-colors-preview {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    margin-top: -2px;
}

.review-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.edit-icon {
    width: 16px;
    height: 16px;
    color: #4299e1;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 16px;
    padding: 8px;
    border-radius: 6px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-icon:hover {
    color: #3182ce;
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Mobile responsiveness for review table */
@media (max-width: 768px) {
    .review-table {
        margin: 0 16px 32px 16px;
    }
    
    .review-row {
        grid-template-columns: 1fr auto;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .review-label {
        font-size: 14px;
        padding-right: 0;
        margin-bottom: 8px;
    }
    
    .review-value {
        grid-column: 1;
        margin-left: 16px;
    }
    
    .review-action {
        grid-column: 2;
        grid-row: 1;
    }
}

.review-color-image {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-right: 4px;
}

/* Navigation */
.navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 20px;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 16px;
    z-index: 998;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: #141559;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0f1147;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 21, 89, 0.3);
}

.btn-light {
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #e3f2fd;
}

.btn-light:hover:not(:disabled) {
    background: #bbdefb;
    border-color: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    flex: none;
    width: 100%;
}

.btn-outline:hover {
    border-color: #4299e1;
    color: #4299e1;
}

.generate-btn {
    background: linear-gradient(135deg, #141559, #48bb78);
    color: white;
    font-size: 18px;
    padding: 20px 24px;
    min-height: 64px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 21, 89, 0.4);
}

/* Color Definitions */
.color-blues { background: linear-gradient(135deg, #63b3ed, #2b6cb0); }
.color-aquas { background: linear-gradient(135deg, #4fd1c7, #38b2ac); }
.color-greens { background: linear-gradient(135deg, #68d391, #38a169); }
.color-purples { background: linear-gradient(135deg, #b794f6, #805ad5); }
.color-pinks { background: linear-gradient(135deg, #f6ad55, #d53f8c); }
.color-reds { background: linear-gradient(135deg, #fc8181, #e53e3e); }
.color-oranges { background: linear-gradient(135deg, #f6ad55, #dd6b20); }
.color-yellows { background: linear-gradient(135deg, #f6e05e, #d69e2e); }
.color-light-greys { background: linear-gradient(135deg, #e2e8f0, #a0aec0); }
.color-dark-greys { background: linear-gradient(135deg, #4a5568, #2d3748); }
.color-designers-choice { background: linear-gradient(135deg, #ed64a6, #f56565, #f6ad55, #68d391, #4fd1c7, #63b3ed, #9f7aea, #a0aec0); }

/* Responsive Design */
@media (max-width: 640px) {
    .headline {
        font-size: 28px;
    }
    
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .color-grid {
        grid-template-columns: 1fr;
    }
    
    .emotion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .choice-buttons {
        grid-template-columns: 1fr;
    }
    
    .navigation {
        padding: 16px;
    }
    
    .btn {
        font-size: 15px;
        padding: 14px 20px;
        min-height: 52px;
    }
    
    .generate-btn {
        font-size: 16px;
        padding: 18px 20px;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 96px 16px 120px;
    }
    
    .headline {
        font-size: 24px;
    }
    
    .subtext {
        font-size: 15px;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .brand-name {
        font-size: 18px;
    }
}

/* Loading and Animation States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.bounce-in {
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.style-tile:focus,
.color-category:focus,
.emotion-btn:focus,
.choice-btn:focus,
.btn:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Custom emotion input field */
.custom-emotion-input {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.custom-emotion-input:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e0;
}

.custom-emotion-input label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
    letter-spacing: 0.025em;
}

.custom-emotion-input .text-area {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.6;
    background: #fff;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.custom-emotion-input .text-area:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background: #ffffff;
}

.custom-emotion-input .text-area:hover {
    border-color: #cbd5e0;
}

.custom-emotion-input .text-area::placeholder {
    color: #a0aec0;
    font-style: italic;
    opacity: 0.8;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .style-tile,
    .color-category,
    .emotion-btn,
    .choice-btn {
        border-width: 3px;
    }
    
    .custom-emotion-input .text-area {
        border-width: 3px;
    }
}
