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

:root {
    --primary: #5a67d8;
    --error: #f56565;
    --success: #48bb78;
    --surface: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --border: #e2e8f0;
    --glass-bg: rgba(0, 0, 0, 0.25);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body, html {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-image: url('https://cdn.myikas.com/images/theme-images/45770173-25a3-450c-b63f-56d283e8faac/image_1950.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.modal-open {
    overflow: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.step-info {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    min-height: 20px;
    transition: opacity 0.3s;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.back-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

.back-button.show {
    display: flex;
}

#skin-analysis-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 40px;
}

.step {
    display: none;
    width: 100%;
    max-width: 520px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.step.active {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.step-title {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.step-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.options-container.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.option-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.option-btn.selected {
    background: white;
    border-color: white;
    color: var(--text-primary);
    font-weight: 600;
}

.action-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-top: 24px;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.action-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.action-button.primary {
    background: white;
    color: var(--text-primary);
    border: none;
}

.action-button.primary:hover {
    background: #f0f0f0;
}

#camera-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4 / 3;
    background: #1a202c;
    border-radius: 16px;
    margin: 0 auto 20px;
    overflow: hidden;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 85%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    color: white;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(229, 62, 62, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(229, 62, 62, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-message.show {
    display: flex;
}

#step-7 {
    max-width: 1200px;
    padding: 0;
    text-align: left;
    background: transparent;
    border: none;
    box-shadow: none;
}

#step-7 .step-title {
    margin-bottom: 24px;
    padding: 16px 20px 0; 
}

#results-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.report-card {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
}

.report-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-header h3 {
    font-size: 20px;
    color: white;
    margin: 0;
}

.report-content {
    padding: 24px;
    color: white;
}

.report-content h4 {
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.report-content p,
.report-content li {
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 8px;
}

.report-content ul {
    list-style-position: inside;
    padding-left: 0;
}

.tabs-container {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn.active {
    color: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: white;
    border-radius: 3px;
}

.routine-content {
    padding: 24px;
    display: none;
}

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

.product-accordion {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-header {
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.2);
}

.accordion-header.active {
    background: rgba(0, 0, 0, 0.3);
}

.product-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.accordion-header h4 {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: white;
    margin: 0;
}

.accordion-header::after {
    content: '+';
    color: white;
    font-size: 24px;
    transition: transform 0.2s;
}

.accordion-header.active::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
}

.accordion-content.active {
    max-height: 35vh;
    overflow-y: auto;
    padding: 8px 16px 16px;
}

.accordion-content p {
    color: white;
    margin-bottom: 8px;
    line-height: 1.5;
    opacity: 0.85;
}

.accordion-content strong {
    font-weight: 600;
    opacity: 1;
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.95);
}

.other-concern-wrapper {
    margin-top: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.other-concern-wrapper.active {
    max-height: 300px;
}

.text-input {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    width: 100%;
    margin-top: 12px;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.text-input:focus {
    outline: none;
    border-color: white;
    background: rgba(0, 0, 0, 0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    height: 80vh;
    max-width: 800px;
    max-height: 600px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-action-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: #e9d8fd;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.modal-action-btn:hover {
    background: #d6bcfa;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f1f1;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e2e2e2;
}

.modal-body {
    flex: 1;
    overflow: hidden;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

@media (min-width: 768px) {
    #results-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .analysis-report-wrapper {
        flex: 1.4;
    }
    .routines-wrapper {
        flex: 1.2;
    }
}

@media (max-width: 767px) {
    #skin-analysis-app {
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto;
    }
    
    #step-7 {
        min-height: calc(100vh - 160px);
        padding-bottom: 40px;
    }
    
    .report-header {
        cursor: pointer;
    }
    .report-header::after {
        content: '+';
        font-size: 24px;
        color: white;
        transition: transform 0.2s;
    }
    .report-header.active::after {
        transform: rotate(45deg);
    }
    .report-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
        padding: 0;
    }
    .report-content.active {
        max-height: 1000px;
        padding: 24px;
    }
    .modal-content {
        height: 70vh;
        width: 95%;
    }
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px auto;
    position: relative;
}

.progress-circle::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border-top: 5px solid white;
    animation: spin 1.5s linear infinite;
}

#progress-percentage {
    font-size: 36px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.percent-sign {
    font-size: 20px;
    font-weight: 500;
    color: white;
    opacity: 0.8;
    margin-left: 2px;
    margin-top: -12px;
}