/* ========================================
   inSeoul 공통 CSS
   ======================================== */

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

/* Typography */
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Color Variables */
:root {
    --primary-color: #5d4037;
    --primary-dark: #4e342e;
    --primary-light: #8d6e63;
    --secondary-color: #a1887f;
    --background: #faf8f5;
    --background-dark: #efebe9;
    --text-color: #5d4037;
    --text-muted: #8d6e63;
    --border-color: #d7ccc8;
    --danger-color: #e53935;
    --danger-dark: #c62828;
    --success-color: #4CAF50;
    --white: #fff;
}

/* ========================================
   공통 헤더
   ======================================== */
.header {
    padding: 16px 40px;
    border-bottom: 1px solid var(--primary-color);
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo svg {
    width: 36px;
    height: 36px;
}

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

.logo-text span {
    color: var(--primary-light);
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.header-nav a:hover {
    text-decoration: underline;
}

/* ========================================
   공통 버튼
   ======================================== */
.btn {
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    border: none;
}

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

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

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--background);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ========================================
   공통 폼 스타일
   ======================================== */
.form-group {
    margin-bottom: 16px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   공통 모달
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   공통 카드
   ======================================== */
.card {
    background-color: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
}

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

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

.card-body {
    padding: 24px;
}

/* ========================================
   공통 토스트
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    display: none;
}

.toast.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   헤더 아이콘 버튼 (수강 내역 등)
   ======================================== */
.header-icon-btn {
    position: relative;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.header-icon-btn .icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    color: var(--primary-color);
    transition: background-color 0.2s;
    text-decoration: none;
}

.header-icon-btn .icon-btn:hover {
    background-color: var(--background-dark);
}

/* ========================================
   알림 벨 아이콘
   ======================================== */
.notification-bell {
    position: relative;
    margin-right: 16px;
}

.bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: background-color 0.2s;
}

.bell-btn:hover {
    background-color: var(--background-dark);
}

.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background-color: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
}

.notification-dropdown-header a {
    font-size: 12px;
    font-weight: normal;
    color: var(--primary-light);
    text-decoration: none;
}

.notification-dropdown-header a:hover {
    text-decoration: underline;
}

.notification-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-dropdown-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--background-dark);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-dropdown-item:hover {
    background-color: var(--background);
}

.notification-dropdown-item:last-child {
    border-bottom: none;
}

.notification-dropdown-item.unread {
    background-color: #fff8e1;
}

.notification-dropdown-item.cancelled {
    border-left: 3px solid var(--danger-color);
}

.notification-dropdown-item.modified {
    border-left: 3px solid #ff9800;
}

.notification-dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--background-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-dropdown-content {
    flex: 1;
    min-width: 0;
}

.notification-dropdown-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-dropdown-message {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-dropdown-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.notification-dropdown-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   공통 뱃지
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-live {
    background-color: var(--danger-color);
    color: var(--white);
}

.badge-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--white);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   공통 푸터
   ======================================== */
.footer {
    padding: 20px 40px;
    border-top: 1px solid var(--primary-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background-color: var(--white);
}

/* ========================================
   공통 유틸리티
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* ========================================
   빈 상태
   ======================================== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========================================
   로딩 스피너
   ======================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   반응형
   ======================================== */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-nav {
        gap: 12px;
    }

    .btn {
        padding: 10px 16px;
    }

    .form-row {
        flex-direction: column;
    }
}
