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

:root {
    --bg: #0d1117;
    --card: #161b22;
    --accent: #f7b500;
    --accent-strong: #f38a00;
    --text: #f0f6fc;
    --muted: #a5adba;
    --border: #30363d;
    --success: #00c48c;
    --danger: #ff5f5f;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'SUIT', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #1f2a37, #0d1117 55%);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

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

header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.switcher {
    display: flex;
    gap: 8px;
}

.switcher button {
    flex: 1;
}

.title-area h1 {
    margin: 0;
    font-size: 32px;
}

.title-area p {
    margin: 4px 0 0;
    color: var(--muted);
}

.primary-btn,
button {
    border: none;
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #0d1117;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(247, 181, 0, 0.25);
}

.secondary-btn {
    background: rgba(240, 246, 252, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.secondary-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

section {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(240, 246, 252, 0.08);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 28px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.section-header.compact {
    margin-bottom: 8px;
}

.section-header h2 {
    margin: 0;
}

.section-header p {
    margin: 0;
    color: var(--muted);
}

.inline-form,
.grid-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.inline-form input,
.inline-form select,
.grid-form input,
.grid-form select,
.grid-form textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 15px;
}

.inline-form select,
.grid-form select {
    cursor: pointer;
}

.inline-form select option,
.grid-form select option {
    background: var(--card);
    color: var(--text);
    padding: 8px;
}

.inline-form input {
    flex: 1;
    min-width: 220px;
}

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

.grid-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

.grid-form button {
    align-self: flex-end;
}

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

.pill-list span {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(247, 181, 0, 0.12);
    color: var(--accent);
    border: 1px solid rgba(247, 181, 0, 0.35);
}

.group-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
}

.group-pill button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.group-pill button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.clothing-group-section {
    margin-bottom: 18px;
}

.clothing-group-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    padding-left: 4px;
}

/* 옷 리스트 한 줄씩 표시 */
.clothing-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clothing-item-row {
    background: var(--card);
    border: 1px solid rgba(240, 246, 252, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s ease;
}

.clothing-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.clothing-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.clothing-item-info {
    flex: 1;
    min-width: 0; /* 텍스트 오버플로우 처리 */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clothing-item-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clothing-item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
}

.clothing-item-group {
    font-weight: 500;
}

.clothing-item-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clothing-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

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

.stats-section {
    margin-bottom: 20px;
}

.top-day-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.top-day-meta {
    font-weight: 600;
    color: var(--text);
}

.card {
    background: var(--card);
    border: 1px solid rgba(240, 246, 252, 0.08);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    gap: 16px;
    padding: 16px;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.card-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

.card-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.card-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-weight: 600;
    font-size: 18px;
}

.card-meta {
    color: var(--muted);
    font-size: 14px;
}

.card-desc {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    opacity: 0.9;
}

.record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn {
    background: rgba(255, 95, 95, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 95, 95, 0.4);
    padding: 8px 12px;
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
}

.muted-text {
    color: var(--muted);
    margin-top: 4px;
}

.satisfaction-panel {
    margin-top: 8px;
    margin-bottom: 16px;
}

/* 인증 관련 스타일 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-section {
    display: flex;
    gap: 10px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn, .nav-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.auth-btn:hover, .nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* 페이지 전환 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(145deg, #1f2937, #374151);
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 450px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

.close {
    color: var(--muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    box-sizing: border-box;
    font-size: 14px;
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--card);
    color: var(--text);
    padding: 8px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 주소 검색 결과 스타일 */
.search-results {
    position: absolute;
    z-index: 1001;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    color: var(--text);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.selected-location {
    background: rgba(247, 181, 0, 0.1);
    border: 1px solid rgba(247, 181, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.selected-location p {
    margin: 0;
    color: var(--text);
}

.selected-location strong {
    color: var(--accent);
}

.error-message {
    color: var(--danger);
    background: rgba(255, 95, 95, 0.15);
    border: 1px solid rgba(255, 95, 95, 0.4);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.success-message {
    color: var(--success);
    background: rgba(95, 255, 95, 0.15);
    border: 1px solid rgba(95, 255, 95, 0.4);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* 마이페이지 스타일 */
.mypage-content {
    max-width: 600px;
}

.user-info-section, .password-change-section, .withdraw-section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item {
    display: flex;
    margin-bottom: 12px;
}

.info-item label {
    width: 100px;
    font-weight: 600;
    color: var(--muted);
}

.password-change-section form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.password-change-section label {
    font-weight: 600;
    color: var(--text);
}

.password-change-section input {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.danger-btn {
    background: rgba(255, 95, 95, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 95, 95, 0.4);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.danger-btn:hover {
    background: rgba(255, 95, 95, 0.25);
}

/* 관리자 페이지 스타일 */
.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-controls button {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.admin-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-list-section {
    overflow-x: auto;
}

#user-list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#user-list-table th,
#user-list-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#user-list-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text);
}

#user-list-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 캘린더 스타일 */
.calendar-container {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header button {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.calendar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: var(--bg);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
}

.calendar-day {
    background: var(--card);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover {
    background: rgba(247, 181, 0, 0.1);
}

.calendar-day.empty {
    cursor: default;
    color: var(--muted);
}

.calendar-day.today {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--accent-strong);
    color: var(--bg);
    font-weight: 600;
}

.calendar-day.has-data .data-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.calendar-day.today.has-data .data-indicator,
.calendar-day.selected.has-data .data-indicator {
    background: var(--bg);
}

/* 기록 섹션 */
.record-section {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.record-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
}

.satisfaction-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.satisfaction-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 500;
}

.satisfaction-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.satisfaction-controls input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.satisfaction-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.satisfaction-controls input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.satisfaction-controls span {
    font-weight: 600;
    font-size: 18px;
    color: var(--accent);
    min-width: 20px;
    text-align: center;
}

.outfit-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.outfit-section h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.add-outfit-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-outfit-btn:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.outfit-records {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.outfit-record {
    background: rgba(247, 181, 0, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.record-content {
    flex: 1;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.clothing-info {
    flex: 1;
    min-width: 0;
}

.clothing-info h5 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.clothing-info .group-name {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--muted);
}

.clothing-info .memo {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: var(--text);
    font-style: italic;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

.record-images {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.clothing-image,
.outfit-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.clothing-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    padding: 4px;
}

.delete-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #ff4444;
    transform: translateY(-1px);
}

.empty-message {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 40px 20px;
}

/* 메시지 토스트 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.message-toast.success {
    background: var(--success);
    color: white;
}

.message-toast.error {
    background: var(--danger);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .grid-form {
        grid-template-columns: 1fr;
    }

    header {
        align-items: stretch;
    }

    section {
        padding: 20px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .calendar-container {
        padding: 16px;
    }
    
    .calendar-day {
        min-height: 40px;
        font-size: 14px;
    }
    
    .record-section {
        padding: 16px;
    }
    
    .satisfaction-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .record-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .clothing-image,
    .outfit-image {
        width: 100%;
        height: 120px;
    }
}

