/* -------------------------------------- */
/* 1. ·¹ÀÌ¾Æ¿ô ±¸Á¶ (Split Layout)        */
/* -------------------------------------- */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6366f1;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Pretendard', sans-serif;
    padding: 0;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-main);
    height: 100vh; /* È­¸é ²Ë Â÷°Ô */
    overflow: hidden; /* ÀÌÁß ½ºÅ©·Ñ ¹æÁö */
}

/* ¸ÞÀÎ ÄÁÅ×ÀÌ³Ê: ÁÂ¿ì ºÐÇÒ */
.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* -------------------------------------- */
/* [¼öÁ¤] °Ë»öÃ¢ µðÀÚÀÎ (X ¹öÆ° Æ÷ÇÔ)     */
/* -------------------------------------- */
.search-wrapper {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #9ca3af;
    pointer-events: none;
}

#optionSearch {
    width: 100%;
    padding: 14px 40px 14px 42px; /* ÁÂ¿ì ¿©¹é È®º¸ */
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    background-color: #ffffff;
    transition: all 0.2s;
    box-sizing: border-box;
}

#optionSearch:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* X (Ãë¼Ò) ¹öÆ° ½ºÅ¸ÀÏ */
.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #d1d5db;
    color: #333;
}

/* -------------------------------------- */
/* ÆÐ³Î ±âº» ¼³Á¤                         */
/* -------------------------------------- */
.left-panel {
    flex: 0 0 50%;
    height: 100%;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    border-right: 1px solid #e5e7eb;
}

.middle-panel {
    flex: 0 0 23%;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    padding: 30px 20px;
    box-sizing: border-box;
    border-right: 1px solid #e5e7eb;
}

.settings-panel {
    flex: 0 0 27%;
    height: 100%;
    overflow-y: auto;
    background: #f9fafb;
    padding: 30px 20px;
    box-sizing: border-box;
}

/* ----------------------------------------------------------- */
/* [ÇÙ½É ¼öÁ¤] ÆÐ³Î È®Àå ·ÎÁ÷À» PC ÇØ»óµµ(1025px ÀÌ»ó)·Î Á¦ÇÑ  */
/* ----------------------------------------------------------- */
@media (min-width: 1025px) {
    /* 1. ¿ÞÂÊ ÆÐ³Î È®Àå ½Ã (50% + 23% = 73%) */
    .left-panel.expanded {
        flex: 0 0 73% !important;
        max-width: 73% !important;
    }

    /* 2. Áß°£ ÆÐ³Î ¼û±è ½Ã */
    .middle-panel.collapsed {
        display: none !important;
    }
}

/* °¡¿îµ¥ ÆÐ³Î¿ë ½ºÅ¸ÀÏ Ä«µå µðÀÚÀÎ */
.section-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.style-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* ¼±ÅÃµÈ ½ºÅ¸ÀÏ Ä«µå °­Á¶ */
.style-card.selected {
    border: 2px solid var(--primary) !important;
    background: #f5f7ff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    transition: transform 0.3s ease;
}

.style-card:hover .card-thumb {
    transform: scale(1);
}

.card-info {
    padding: 10px;
    text-align: center;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

/* µ¸º¸±â ¹öÆ° */
.zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 5;
    cursor: zoom-in;
}

.zoom-btn::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid #000000;
    border-radius: 50%;
    position: absolute;
    top: 7px;
    left: 7px;
}

.zoom-btn::after {
    content: '';
    width: 2px;
    height: 8px;
    background: #000000;
    position: absolute;
    bottom: 6px;
    right: 8px;
    transform: rotate(-45deg);
}

.style-card:hover .zoom-btn {
    opacity: 1;
}

.zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ¸ð´Þ ÆË¾÷ ½ºÅ¸ÀÏ */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    object-fit: contain;
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ½ºÅ©·Ñ¹Ù µðÀÚÀÎ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }


/* -------------------------------------- */
/* 2. Çì´õ ¹× Å¸ÀÌÆ÷±×·¡ÇÇ                */
/* -------------------------------------- */
header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 0px solid #e5e7eb;
    width: 100%;
}

.guide-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    margin-left: auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.step-num {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid #c7d2fe;
}

.step-item.step-action .step-num {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.step-item.step-action .step-text {
    color: var(--primary);
}

.step-arrow {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: bold;
}

h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding-left: 12px;
    margin: 30px 0 15px 0;
    font-size: 18px;
    font-weight: 700;
}

/* ¾ð¾î ½ºÀ§Ä¡ */
.lang-switch-container {
    display: flex;
    background: #e5e7eb;
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    transition: 0.3s;
}

.lang-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ¼­ºê Å¸ÀÌÆ² ½ºÅ¸ÀÏ (¿É¼Ç ±×·ì) */
.clothing-options-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    align-items: center;
}

.option-group-title {
    width: 100%;
    grid-column: 1 / -1;
    margin-top: 24px;
    margin-bottom: 12px;
    text-align: left;
}

.option-group-title span {
    display: inline-block;
    background-color: #e7f5ff;
    color: #1c7ed6;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #A6DAFF;
    padding: 6px 12px;
    border-radius: 6px;
}


/* -------------------------------------- */
/* 3. ¿É¼Ç Ä«µå & UI ¿ä¼Ò                 */
/* -------------------------------------- */
.accordion-container {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.acc-header {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 600;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.acc-header:hover {
    background: #f9fafb;
    color: var(--primary);
}

.acc-header::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    margin-bottom: 4px;
}

.acc-content {
    display: none;
    padding: 24px;
    background: #fdfdfd;
    border-top: 1px solid #f3f4f6;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-card {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    position: relative;
}

@media (max-width: 768px) {
    .option-card {
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 500;
    }
}

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

.option-card.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}

/* ÅøÆÁ */
.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    max-width: 400px;
    background: #4F46E5;
    color: #fff;
    text-align: left;
    padding: 10px 14px;
    border-radius: 6px;
    position: absolute;
    z-index: 10;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.2s;
    font-size: 13px;
    pointer-events: none;
    line-height: 1.3;
}

.option-card:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

#negativePrompt {
    margin: 0 0 10px;
}

/* ÀÔ·ÂÃ¢ ¶óº§ ¹îÁö ½ºÅ¸ÀÏ */
.input-field label {
    display: inline-block;
    width: fit-content;
    background-color: #e7f5ff;
    color: #1c7ed6;
    border: 1px solid #A6DAFF;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* -------------------------------------- */
/* 4. ¿ìÃø ÆÐ³Î ¿ä¼Ò (ÀÔ·Â/°á°ú)          */
/* -------------------------------------- */
textarea, input[type="text"] {
    width: 100%;
    border-radius: var(--border-radius);
    padding: 16px;
    border: 2px solid #e5e7eb;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.2s;
}

textarea:focus, input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

#extra {
    height: 150px;
    resize: vertical;
    margin-bottom: 20px;
}

#result {
    height: 240px;
    margin-top: 10px;
    background: #f8fafc;
    color: #333;
    font-family: monospace;
    line-height: 1.6;
}

/* ¹ÌµåÀú´Ï Åä±Û */
.mj-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #eef2ff;
    border-radius: var(--border-radius);
    border: 1px solid #c7d2fe;
}

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

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ¹öÆ° */
.btn-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 7;
    padding: 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    font-weight: 700;
}

.action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-reset {
    flex: 3;
    padding: 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--border-radius);
    background: #ef4444;
    color: #fff;
    border: none;
    font-weight: 700;
}

.btn-reset:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.copy-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.copy-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}


/* -------------------------------------- */
/* [½Å±Ô] ÇÁ¸®¼Â ½ºÅ¸ÀÏ (¿À¸¥ÂÊ ÆÐ³Î¿ë)   */
/* -------------------------------------- */
.preset-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 4px 0 10px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.preset-scroll-wrapper:active {
    cursor: grabbing;
}

.preset-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.preset-list {
    display: flex;
    gap: 8px;
    padding: 0 10px;
}

.preset-tag {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.preset-tag:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.preset-tag:active {
    transform: translateY(0);
}

/* -------------------------------------- */
/* [½Å±Ô] °á°úÃ¢ ÅÇ & È÷½ºÅä¸® ½ºÅ¸ÀÏ     */
/* -------------------------------------- */
.result-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.tab-buttons {
    display: flex;
    gap: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 700;
    color: #9ca3af;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
    font-family: inherit;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

/* È÷½ºÅä¸® ¸®½ºÆ® ¿µ¿ª */
.history-container {
    height: 300px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
}

.history-container::-webkit-scrollbar {
    width: 6px;
}

.history-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#historyList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.history-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
}

.history-text-preview {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: monospace;
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.history-btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-weight: 600;
}

.history-btn-mini:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.empty-history {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding-top: 40px;
}

/* -------------------------------------- */
/* [Áß¿ä] ¸ð¹ÙÀÏ ´ëÀÀ ½ºÅ¸ÀÏ              */
/* -------------------------------------- */
@media (max-width: 1024px) {
    header {
        gap: 15px;
    }

    .guide-flow {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .main-container {
        flex-direction: column;
        overflow-y: auto;
    }

    .left-panel, .middle-panel, .settings-panel {
        flex: none;
        width: 100%;
        height: auto;
        border-right: none;
    }

    .left-panel {
        padding: 10px;
    }

    /* ½ºÅ¸ÀÏ ÇÁ¸®¼Â ±×¸®µå: ¸ð¹ÙÀÏÀº 2¿­ */
    .preset-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* ¸ð¹ÙÀÏ¿¡¼­´Â Áß°£ ÆÐ³ÎÀÌ ¼û°ÜÁ®µµ(collapsed) ¿ÞÂÊ ÆÐ³ÎÀ» È®ÀåÇÏÁö ¾Ê°í
       Áß°£ ÆÐ³Î¸¸ »ç¶óÁö°Ô ÇÏ¿©, ¿ÞÂÊ ÆÐ³ÎÀÌ ÀÚ¿¬½º·´°Ô 100%¸¦ À¯ÁöÇÏµµ·Ï ÇÔ */
    .middle-panel.collapsed {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .step-text {
        font-size: 12px;
    }
    .guide-flow {
        padding: 8px 12px;
        gap: 4px;
    }
}


/* SEO ÃÖÀûÈ­¸¦ À§ÇÑ ÅØ½ºÆ® ¼û±è Ã³¸® */
.seo-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}