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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #D4E8FA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Portfolio Header */
.portfolio-header {
    padding: 48px 24px 32px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.project-label {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #4285F4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.project-title {
    font-size: 32px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.project-description {
    font-size: 16px;
    color: #555555;
    line-height: 1.5;
}

/* Main Design Frame */
.frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 500px;
}

/* White card */
.card {
    width: 499px;
    height: auto;
    min-height: 302px;
    background: #FAFAFA;
    border-radius: 17px;
    border: 1px solid #E3E3E3;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* Input container (dropdowns + prompt) */
.input-container {
    width: 482px;
    height: fit-content;
    margin: 8px auto 0 auto;
    background: #FAFAFA;
    border: 1px solid #D1D1D1;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    overflow: visible;
    box-sizing: border-box;
}

/* Left side: dropdowns and prompt */
.input-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 6px 12px;
    justify-content: center;
}

/* Right side: submit button */
.input-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

/* Card header with dropdowns */
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 14px;
    margin: 4px 0 8px 0;
}

/* Dropdown container */
.dropdown {
    position: relative;
}

/* Dropdown toggle button */
.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    height: 16px;
    background: #F5F5F5;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    color: #666666;
    transition: all 0.15s ease;
}

.dropdown-toggle:hover {
    background: #EBEBEB;
    border-color: #D5D5D5;
}

.dropdown-toggle.active {
    background: #EBEBEB;
    border-color: #CCCCCC;
    color: #333333;
}

.dropdown-label {
    font-weight: 400;
}

.dropdown-arrow {
    color: inherit;
    transition: transform 0.15s ease;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 130px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    color: #333333;
    cursor: pointer;
    transition: background 0.1s ease;
}

.dropdown-item:first-child {
    border-radius: 7px 7px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 7px 7px;
}

.dropdown-item:hover {
    background: #F5F5F5;
}

.dropdown-item.active {
    background: #EBEBEB;
    color: #333333;
}

/* ===== STYLE DROPDOWN CUSTOMIZATION ===== */
.dropdown-style .dropdown-toggle {
    /* Customize style dropdown appearance here */
    border-radius: 14px;
    border: none;
    padding: 8px 8px;
}

.dropdown-style .dropdown-menu {
    /* Customize style dropdown menu here */
    display: block; /* placeholder to avoid empty ruleset */
}

.dropdown-style .dropdown-item {
    /* Customize style dropdown items here */
    display: block; /* placeholder to avoid empty ruleset */
}

/* ===== MODEL DROPDOWN CUSTOMIZATION ===== */
.dropdown-model .dropdown-toggle {
    /* Customize model dropdown appearance here */
background: transparent;
border: none;
box-shadow: none;
}

.dropdown-model .dropdown-menu {
    /* Customize model dropdown menu here */
    display: block; /* placeholder to avoid empty ruleset */
}

.dropdown-model .dropdown-item {
    /* Customize model dropdown items here */
    display: block; /* placeholder to avoid empty ruleset */
}

/* ===== SPECIFIC DROPDOWN TOGGLE OVERRIDES ===== */
#styleToggle {
    padding-left: 8px;
    padding-right: 8px;
    background-color: rgb(232, 232, 232);
}

#versionToggle {
    margin: 4px 8px;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Submit button */
.submit-btn {
    margin-left: auto;
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A1A1A;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.submit-btn:hover {
    background: #333333;
}

.submit-btn svg {
    color: #FFFFFF;
    width: 12px;
    height: 12px;
}

/* Card body with text input */
.card-body {
    flex: 1;
    padding: 0;
    display: flex;
    align-items: flex-start;
}

.text-input {
    width: 100%;
    padding: 0;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: #1A1A1A;
    background: #FAFAFA;
    resize: none;
    overflow-y: auto;
    min-height: 20px;
    max-height: 200px;
    line-height: 1.4;
}

.text-input::placeholder {
    color: #999999;
}

/* Questionnaire */
.questionnaire {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    margin-top: 0;
    flex: 1;
}

.questionnaire.expanded {
    max-height: 500px;
    height: 230px;
    margin: 0 32px 8px 32px;
    padding: 8px;
    border-left: 1px solid #E5E5E5;
    border-right: 1px solid #E5E5E5;
    border-bottom: 1px solid #E5E5E5;
    border-radius: 0px 0px 18px 18px;
    text-align: left;
    overflow: visible;
}

/* Hide questionnaire when other states are active */
.card:has(.result-state.show) .questionnaire,
.card:has(.generating-state.show) .questionnaire {
    display: none;
}

.questionnaire-box {
    margin: 0;
    border: none;
    border-radius: 8px;
}

.questionnaire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: #FAFAFA;
    border-bottom: none;
}

.questionnaire-title {
    font-size: 12px;
    font-weight: 500;
    color: #333333;
}

.questionnaire-progress {
    font-size: 12px;
    color: #888888;
}

.questionnaire-scroll {
    max-height: 180px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-top: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.questionnaire-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.question {
    padding: 8px 16px;
    margin: 0 0 16px 0;
}

.question-title {
    font-size: 12px;
    font-weight: 500;
    color: #1A1A1A;
    margin-bottom: 12px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    overflow: hidden;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-bottom: 1px solid #F0F0F0;
}

.option:last-child {
    border-bottom: none;
}

.option:hover {
    background: #F8F8F8;
}

.option input[type="radio"] {
    display: none;
}

.radio-circle {
    width: 16px;
    height: 16px;
    border: 2px solid #CCCCCC;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.option input[type="radio"]:checked + .radio-circle {
    border-color: #333333;
    background: #333333;
}

.option input[type="radio"]:checked + .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #FFFFFF;
    border-radius: 50%;
}

.option-text {
    font-size: 12px;
    color: #333333;
}

/* Continue Button */
.continue-container {
    padding: 0 160px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.continue-container.show {
    opacity: 1;
    visibility: visible;
}

.continue-btn {
    width: 100%;
    padding: 8px 20px;
    background: #1A1A1A;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.continue-btn:hover {
    background: #333333;
}

/* Generating State */
.generating-state {
    display: none;
    padding: 24px;
}

.generating-state.show {
    display: block;
}

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

.generating-placeholder {
    width: 160px;
    height: 120px;
    background: #F5F5F5;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generating-spinner {
    width: 8px;
    height: 8px;
    background: #666666;
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.generating-text {
    font-size: 12px;
    color: #999999;
    font-style: italic;
}

/* Result State */
.result-state {
    display: none;
    padding: 16px;
}

.result-state.show {
    display: block;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.result-image-container {
    position: relative;
    width: 198px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.result-actions {
    position: absolute;
    top: 0;
    right: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12px;
    color: #666666;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.action-btn:hover {
    color: #333333;
}

/* Edit button as toggle - active state when in edit mode */
.result-state.edit-mode .action-btn {
    background-color: rgb(232, 232, 232);
    padding: 6px 10px;
    border-radius: 4px;
}

/* Create Avatar button dimmed in edit mode */
.result-state.edit-mode .create-avatar-btn {
    opacity: 0.5;
}

/* Prompt input grayed out in edit mode */
.card:has(.result-state.edit-mode) .text-input {
    color: #C5C5C5;
    pointer-events: none;
}

/* Submit button muted in edit mode */
.card:has(.result-state.edit-mode) .submit-btn {
    background: #F3F3F3;
    pointer-events: none;
}

.card:has(.result-state.edit-mode) .submit-btn svg {
    color: #D1D1D1;
}

.result-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.create-avatar-btn {
    padding: 8px 16px;
    background: #FF6200;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.create-avatar-btn:hover {
    background: #f25f04;
}

/* Edit Mode Styles */

/* Scale SVG to fill container */
.person-placeholder {
    width: 100%;
    height: 100%;
}

/* SVG zone hover styles */
.svg-zone {
    cursor: default;
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
    stroke: transparent;
    stroke-width: 0;
}

/* Only enable hover/click in edit mode */
.result-state.edit-mode .svg-zone {
    cursor: pointer;
}

.result-state.edit-mode .svg-zone:hover {
    stroke: #4285F4;
    stroke-width: 2;
}

.svg-zone.selected {
    stroke: #4285F4;
    stroke-width: 2;
}

/* Edit prompt - positioned on card level */
.edit-prompt-container {
    display: none;
    margin: 12px auto 0;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    z-index: 100;
    width: fit-content;
}

.edit-prompt-container.show {
    display: flex;
}

.edit-prompt-input {
    width: 140px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    color: #333333;
    outline: none;
}

.edit-prompt-input::placeholder {
    color: #999999;
}

.edit-prompt-submit {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F3F3;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #D1D1D1;
    transition: all 0.15s ease;
    padding: 0;
}

.edit-prompt-submit:hover {
    color: #333333;
}

/* Active state when there's text in the edit prompt */
.edit-prompt-submit.active {
    background: #1A1A1A;
    color: #FFFFFF;
}

.edit-prompt-submit.active:hover {
    background: #333333;
}

.edit-prompt-submit svg {
    width: 16px;
    height: 16px;
}

/* Portfolio Footer */
.portfolio-footer {
    padding: 32px 24px 48px;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.design-specs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.spec-item {
    font-size: 12px;
    color: #666666;
    font-weight: 500;
}

.spec-divider {
    color: #AAAAAA;
    font-size: 10px;
}

.footer-credit {
    font-size: 14px;
    color: #888888;
}

/* Responsive Design */
@media (max-width: 600px) {
    .portfolio-header {
        padding: 32px 20px 24px;
    }
    
    .project-title {
        font-size: 26px;
    }
    
    .project-description {
        font-size: 14px;
    }
    
    .frame {
        padding: 16px;
    }
    
    .card {
        max-width: 100%;
    }
    
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .export-btn {
        margin-left: auto;
    }
    
    .design-specs {
        flex-direction: column;
        gap: 8px;
    }
    
    .spec-divider {
        display: none;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-header {
    animation: fadeInUp 0.6s ease-out;
}

.card {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.portfolio-footer {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}
