/**
 * AI Cosmetologist - Gemini (Material 3) Theme
 * Clean, minimal, Google-inspired beauty interface
 */

/* ==========================================================================
   Google Fonts
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Open+Sans:wght@400;600&display=swap');

/* ==========================================================================
   Variables - Gemini Material 3 Palette
   ========================================================================== */

:root {
    /* Brand Colors */
    --primary: #1A73E8;
    /* Google Blue */
    --primary-hover: #1557B0;
    --secondary: #D7AEFB;
    /* Soft Purple Accent */
    --accent: #1967D2;
    --accent-gradient: linear-gradient(135deg, #1A73E8 0%, #8AB4F8 100%);

    /* Gemini Gradient for AI Elements */
    --gemini-gradient: linear-gradient(90deg, #4285F4 0%, #9B72CB 50%, #D96570 100%);
    --gemini-glow: 0 0 20px rgba(66, 133, 244, 0.3);

    /* Text */
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-tertiary: #80868B;
    --text-on-primary: #FFFFFF;

    /* Surfaces */
    --bg-page: #FFFFFF;
    --bg-surface: #F8F9FA;
    --bg-surface-variant: #F1F3F4;
    --bg-elevation-1: #FFFFFF;

    /* Borders & Dividers */
    --border: #DADCE0;
    --border-focus: #1A73E8;

    /* Geometry */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;

    /* Elevation / Shadows */
    --shadow-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
    --shadow-none: none;

    /* Typography */
    --font-heading: 'Google Sans', 'Roboto', sans-serif;
    /* Fallback to Roboto */
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Animations */
    --transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ==========================================================================
   Global Layout
   ========================================================================== */

.ai-cosmetologist-wrapper {
    max-width: 720px;
    /* Narrower for cleaner look */
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Analysis Form - Material Card
   ========================================================================== */

.ai-cosmetologist-form {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 48px;
    /* Clean look, minimal shadow */
    box-shadow: none;
    border: 1px solid transparent;
    /* Or keeping it flat like Gemini web interface which acts like a chat bubble sometimes, 
       but for a form we want structure. Material 3 uses filled surface colors. */
    background: var(--bg-surface-variant);
}

/* Header */
.ai-cosmetologist-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 400;
    /* Google style is often lighter weights for large type */
    text-align: center;
    margin: 0 0 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.ai-cosmetologist-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 40px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Upload Zone - Clean Rounded
   ========================================================================== */

.ai-cosmetologist-upload-zone {
    display: block;
    position: relative;
    background: var(--bg-page);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 32px;
    z-index: 1;
}

.ai-cosmetologist-upload-zone:hover {
    border-color: var(--primary);
    background: #F8F9FA;
}

.ai-cosmetologist-upload-zone:focus-within {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

.ai-cosmetologist-upload-zone.has-file {
    border-style: solid;
    border-color: var(--primary);
    background: #E8F0FE;
    /* Light Blue tint */
}

/* Content wrapper specific for pointer events */
.ai-cosmetologist-upload-zone>*:not(input) {
    pointer-events: none;
    position: relative;
    z-index: 2;
}

/* Upload Icon - Simple Circle */
.ai-cosmetologist-upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: var(--bg-surface-variant);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition);
}

.ai-cosmetologist-upload-zone:hover .ai-cosmetologist-upload-icon {
    background: #E8F0FE;
    color: var(--primary-hover);
    transform: scale(1.1);
}

.ai-cosmetologist-upload-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

.ai-cosmetologist-upload-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-cosmetologist-upload-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-cosmetologist-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Preview */
.ai-cosmetologist-preview {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.ai-cosmetologist-preview img {
    max-width: 240px;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.ai-cosmetologist-preview-name {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================================================
   Submit Button - Gemini Gradient
   ========================================================================== */

.ai-cosmetologist-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 0 32px;
    height: 48px;
    /* Standard Material height */

    /* Gemini Gradient */
    background: var(--gemini-gradient);
    background-size: 200% auto;

    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius-pill);

    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.25px;

    cursor: pointer;
    transition: 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-cosmetologist-submit:hover {
    background-position: right center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.ai-cosmetologist-submit:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-cosmetologist-submit:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

.ai-cosmetologist-submit svg {
    margin-top: -2px;
    /* Visual alignment */
}

/* Loading State */
.ai-cosmetologist-submit.loading .ai-cosmetologist-upload-text {
    visibility: hidden;
}

/* ==========================================================================
   Results - Clean Cards
   ========================================================================== */

.ai-cosmetologist-results {
    margin-top: 48px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-cosmetologist-results-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
}

/* Analysis Card */
.ai-cosmetologist-analysis {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
}

.ai-cosmetologist-analysis-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.ai-cosmetologist-analysis-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.ai-cosmetologist-analysis-summary {
    flex: 1;
}

.ai-cosmetologist-skin-type {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-cosmetologist-skin-condition {
    font-size: 16px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 12px;
}

/* Tags - Material Chips */
.ai-cosmetologist-concerns,
.ai-cosmetologist-ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-cosmetologist-concern-tag,
.ai-cosmetologist-ingredient-tag {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    /* Small rounding or pill? Gemini usually uses small rounding for code/tags, pill for filters */
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.ai-cosmetologist-concern-tag {
    background: var(--bg-surface-variant);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.ai-cosmetologist-ingredient-tag {
    background: #E8F0FE;
    color: var(--primary);
    border: 1px solid transparent;
}

/* Recommendations */
.ai-cosmetologist-recommendations {
    background: var(--bg-surface-variant);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
}

.ai-cosmetologist-recommendations-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.ai-cosmetologist-recommendation-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-cosmetologist-recommendation-item:last-child {
    border-bottom: none;
}

.ai-cosmetologist-recommendation-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-cosmetologist-recommendation-value {
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
}

/* ==========================================================================
   Products - Material Grid
   ========================================================================== */

.ai-cosmetologist-products {
    margin-top: 48px;
}

.ai-cosmetologist-products-title {
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 32px;
}

.ai-cosmetologist-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.ai-cosmetologist-product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.ai-cosmetologist-product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.ai-cosmetologist-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-surface-variant);
}

.ai-cosmetologist-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-cosmetologist-product-content {
    padding: 16px;
}

.ai-cosmetologist-product-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ai-cosmetologist-product-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.ai-cosmetologist-product-name a:hover {
    color: var(--primary);
}

.ai-cosmetologist-product-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-cosmetologist-product-reason {
    font-size: 12px;
    color: var(--text-primary);
    background: #E8F0FE;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.ai-cosmetologist-product-price {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ai-cosmetologist-product-button {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.ai-cosmetologist-product-button:hover {
    background: #E8F0FE;
    border-color: var(--primary);
}

/* ==========================================================================
   Diary
   ========================================================================== */

.ai-cosmetologist-diary {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px;
}

.ai-cosmetologist-diary-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.ai-cosmetologist-diary-item:hover {
    box-shadow: var(--shadow-1);
}

.ai-cosmetologist-diary-delete {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.ai-cosmetologist-diary-delete:hover {
    color: #D93025;
    /* Google Red */
}

/* Pagination */
.ai-cosmetologist-pagination button {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
}

.ai-cosmetologist-pagination button:hover {
    background: var(--bg-surface-variant);
    color: var(--text-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .ai-cosmetologist-form {
        padding: 24px;
    }

    .ai-cosmetologist-upload-zone {
        padding: 32px 20px;
    }

    .ai-cosmetologist-title {
        font-size: 24px;
    }

    .ai-cosmetologist-recommendation-item {
        flex-direction: column;
        gap: 4px;
    }

    .ai-cosmetologist-recommendation-value {
        text-align: left;
        max-width: 100%;
    }
}