/* ═══════════════════════════════════════════════════════════
   PIMOUNT Size Recommender - CSS
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-main: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-input: #F5F5F5;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --accent: #2563EB;
    --accent-light: #DBEAFE;
    --accent-dark: #1D4ED8;
    --success: #10B981;
    --success-light: #D1FAE5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-main: #0F0F0F;
    --bg-card: #1A1A1A;
    --bg-input: #262626;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;
    --border: #333333;
    --border-light: #2A2A2A;
    --accent: #3B82F6;
    --accent-light: #1E3A5F;
    --accent-dark: #60A5FA;
    --success: #34D399;
    --success-light: #064E3B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

/* ═══════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════ */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background var(--transition), border var(--transition);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--border);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.sun-icon { display: block; }
.moon-icon { display: none; }

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* ═══════════════════════════════════════════════════════════
   Main Container
   ═══════════════════════════════════════════════════════════ */

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

.app-header {
    text-align: center;
    margin-bottom: 32px;
}

.app-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   Input Section
   ═══════════════════════════════════════════════════════════ */

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.input-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Slider Group */
.slider-group {
    margin-bottom: 20px;
}

.slider-group:last-child {
    margin-bottom: 0;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.label-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.label-value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--text-secondary);
}

.label-value input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition);
}

.label-value input:focus {
    outline: none;
    border-color: var(--accent);
}

.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Icon Options (Body Type & Fit) */
.icon-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.fit-types {
    grid-template-columns: repeat(3, 1fr);
}

.icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--border-light);
}

.icon-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
}

.icon-btn span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

.icon-btn.active span {
    color: var(--accent);
    font-weight: 600;
}

/* Body Type Figures */
.icon-figure {
    width: 32px;
    height: 50px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.figure-head {
    width: 12px;
    height: 12px;
    background: var(--text-secondary);
    border-radius: 50%;
    margin-bottom: 2px;
    transition: background var(--transition);
}

.figure-body {
    flex: 1;
    background: var(--text-secondary);
    border-radius: 4px 4px 2px 2px;
    transition: all var(--transition);
}

.figure-legs {
    width: 100%;
    height: 16px;
    display: flex;
    gap: 2px;
    justify-content: center;
}

.figure-legs::before,
.figure-legs::after {
    content: '';
    width: 8px;
    height: 100%;
    background: var(--text-secondary);
    border-radius: 0 0 2px 2px;
    transition: background var(--transition);
}

.icon-btn.active .figure-head,
.icon-btn.active .figure-body,
.icon-btn.active .figure-legs::before,
.icon-btn.active .figure-legs::after {
    background: var(--accent);
}

/* Body type variations */
.icon-figure.slim .figure-body { width: 14px; }
.icon-figure.slim .figure-legs::before,
.icon-figure.slim .figure-legs::after { width: 6px; }

.icon-figure.normal .figure-body { width: 18px; }
.icon-figure.normal .figure-legs::before,
.icon-figure.normal .figure-legs::after { width: 8px; }

.icon-figure.muscular .figure-body { width: 24px; border-radius: 6px 6px 2px 2px; }
.icon-figure.muscular .figure-legs::before,
.icon-figure.muscular .figure-legs::after { width: 10px; }

.icon-figure.chubby .figure-body { width: 26px; border-radius: 8px 8px 4px 4px; }
.icon-figure.chubby .figure-legs::before,
.icon-figure.chubby .figure-legs::after { width: 11px; }

/* Fit Icons */
.fit-icon {
    width: 36px;
    height: 50px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.icon-btn.active .fit-icon {
    color: var(--accent);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn:hover {
    background: var(--border-light);
}

.tab-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.sub-category {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-category.hidden {
    display: none;
}

.sub-btn {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.sub-btn:hover {
    border-color: var(--text-muted);
}

.sub-btn.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════
   Result Section
   ═══════════════════════════════════════════════════════════ */

.result-section {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 900px) {
    .result-section {
        position: static;
    }
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
}

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

.result-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.size-badge {
    width: 72px;
    height: 72px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.result-text {
    flex: 1;
}

.main-recommend {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sub-recommend {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Result Details */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.detail-icon svg {
    width: 100%;
    height: 100%;
}

/* Size Comparison Chart */
.size-comparison {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.size-comparison h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.size-chart-mini {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 80px;
    gap: 8px;
}

.chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.chart-bar {
    width: 100%;
    height: 60px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    background: var(--text-muted);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chart-item.recommended .bar-fill {
    background: var(--accent);
}

.chart-item span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.chart-item.recommended span {
    color: var(--accent);
    font-weight: 700;
}

.chart-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}

/* Action Buttons */
.result-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.action-btn.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* Similar Reviews */
.similar-reviews {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.similar-reviews h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.review-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.review-content {
    flex: 1;
}

.review-info {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.review-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Size Table */
.size-table-wrapper {
    overflow-x: auto;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.size-table th,
.size-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.size-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
}

.size-table tr.highlight {
    background: var(--accent-light);
}

.size-table tr.highlight td:first-child {
    font-weight: 700;
    color: var(--accent);
}

.table-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Share Modal */
.share-modal .modal-body {
    text-align: center;
}

.share-preview {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
}

.share-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.share-size {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.share-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

.share-btn.kakao {
    background: #FEE500;
    color: #3C1E1E;
}

.share-btn.kakao:hover {
    background: #F5DC00;
}

.share-btn.copy {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.share-btn.copy:hover {
    background: var(--border-light);
}

/* ═══════════════════════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast svg {
    width: 18px;
    height: 18px;
    color: var(--success);
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .container {
        padding: 66px 16px 24px;
    }

    .app-header h1 {
        font-size: 24px;
    }

    .app-header p {
        font-size: 14px;
    }

    .input-group {
        padding: 16px;
    }

    .icon-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .fit-types {
        grid-template-columns: repeat(3, 1fr);
    }

    .icon-btn {
        padding: 12px 6px;
    }

    .icon-btn span {
        font-size: 11px;
    }

    .result-card {
        padding: 20px;
    }

    .result-main {
        gap: 16px;
    }

    .size-badge {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .main-recommend {
        font-size: 18px;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }

    .action-btn {
        flex-direction: row;
        justify-content: center;
        padding: 14px;
    }

    .share-buttons {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════ */

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════ */

footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    margin-top: 40px;
    text-align: center;
    transition: all var(--transition);
}

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

.footer-brand {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-contact {
    font-size: 13px;
    color: var(--text-secondary);
}
