/* static/css/style.css */

/* === 기본 & 공통 스타일 === */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa; /* 약간 더 밝은 배경 */
    color: #212529; /* 기본 텍스트 색상 */
    line-height: 1.6;
}



.main-content {
    padding: 25px;
    max-width: 1200px; /* 컨텐츠 최대 너비 제한 */
    margin: 0 auto; /* 중앙 정렬 */
}

h1, h2, h3, h4 {
    color: #343a40; /* 제목 색상 */
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: 0.25rem;
    overflow: hidden; /* radius 적용을 위해 */
}
th, td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #dee2e6; /* 구분선 */
    text-align: left;
    vertical-align: middle;
}
th {
    background-color: #f8f9fa; /* 헤더 배경색 */
    font-weight: 600;
    color: #495057;
}
tr:hover {
    background-color: #f1f8ff; /* 행 호버 시 배경색 */
}

/* === 버튼 스타일 === */
.button, button[type="submit"], input[type="submit"] { /* form 안의 button도 포함 */
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 5px 2px;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}
.lesson-status-form select, .lesson-status-form button {
    padding: 3px 6px;
    font-size: 0.8em;
    vertical-align: middle; /* 세로 정렬 */
}
.lesson-status-form select { margin-right: 5px; }
.open{
    display: inline-block;
    padding: 0rem 1rem;
    margin: 0px 0px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background-color: #343a40;
    border: 1px solid #343a40;
    border-radius: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}
.button:hover, button[type="submit"]:hover, input[type="submit"]:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
}
.button-danger { background-color: #dc3545; border-color: #dc3545;}
.button-danger:hover { background-color: #c82333; border-color: #bd2130;}
.button-secondary { background-color: #6c757d; border-color: #6c757d;}
.button-secondary:hover { background-color: #5a6268; border-color: #545b62;}

/* === 폼 요소 스타일 === */
.form-control, .form-select, input[type="text"], input[type="tel"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    box-sizing: border-box; /* 중요 */
    margin-bottom: 0.5rem; /* 아래쪽 여백 */
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }

/* === 플래시 메시지 (base.html로 옮김) === */
.flash-messages { list-style: none; padding: 0; margin: 0 0 20px 0; }
.flash-messages li { padding: 12px 15px; border-radius: 4px; margin-bottom: 10px; border-left-width: 5px; border-left-style: solid; }
.flash-messages .info { background-color: #e7f3fe; border-left-color: #2196F3; color: #0d47a1;}
.flash-messages .success { background-color: #d4edda; border-left-color: #28a745; color: #155724;}
.flash-messages .warning { background-color: #fff3cd; border-left-color: #ffc107; color: #856404;}
.flash-messages .danger { background-color: #f8d7da; border-left-color: #dc3545; color: #721c24;}

/* === 특정 페이지 스타일 === */
/* web_member_detail.html */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }
.info-card { background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.info-card h2 { margin-top: 0; font-size: 1.3em; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 15px; }
.info-card p { margin: 5px 0; font-size: 0.95em; }
.info-card strong { min-width: 110px; display: inline-block; font-weight: 500; color: #555; }

.ticket-item {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: #ffffff; /* 기본 배경색 */
    transition: box-shadow 0.2s ease-in-out;
}

.ticket-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.ticket-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0056b3; /* 티켓 이름 색상 */
    font-size: 1.1em;
    display: flex; /* 티켓 이름과 상태 뱃지를 같은 줄에 정렬 */
    justify-content: space-between; /* 양쪽으로 붙이기 */
    align-items: center; /* 세로 중앙 정렬 */
}

.ticket-item p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #333;
}
.ticket-item p strong { /* <p> 안의 <strong> 태그 스타일 */
    font-weight: 600; /* 기존 info-card strong보다 약간 더 강조 */
    color: #111;
    min-width: 70px; /* 라벨 너비 고정 (선택적) */
    display: inline-block;
}

.ticket-status-badge {
    font-weight: normal;
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 10px; /* 더 둥글게 */
    color: white; /* 기본 글자색은 흰색 */
    text-transform: uppercase;
}

/* 티켓 상태별 뱃지 배경색 */
.status-active { background-color: #28a745; } /* 초록색 (활성) */
.status-on_hold { background-color: #ffc107; color: #333; } /* 노란색 (홀딩) - 글자색 변경 */
.status-expired { background-color: #6c757d; } /* 회색 (만료) */
.status-depleted { background-color: #fd7e14; } /* 주황색 (소진) */
.status-cancelled { background-color: #dc3545; } /* 빨간색 (취소) */
/* 필요에 따라 다른 상태에 대한 스타일 추가 */

/* web_lesson_schedule.html */
.schedule-page-container { max-width: 900px; margin: 0 auto; }
.pro-selector { margin-bottom: 20px; text-align: center; }
.pro-selector .pro-btn { display: inline-block; padding: 10px 20px; margin: 5px; border: 1px solid #ccc; border-radius: 20px; cursor: pointer; text-decoration: none; color: #333; background-color: #f8f9fa; transition: background-color 0.2s, color 0.2s; }
.pro-selector .pro-btn:hover { background-color: #e9ecef; }
.pro-selector .pro-btn.active { background-color: #007bff; color: white; border-color: #007bff; }

.date-slider-container {
    overflow-x: auto; /* 가로 스크롤 가능 */
    white-space: nowrap; /* 내부 요소들이 한 줄로 이어지도록 */
    padding: 10px 0;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    scrollbar-width: thin; /* Firefox 스크롤바 얇게 */
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.date-slider-container::-webkit-scrollbar {
    height: 8px; /* 스크롤바 높이 */
}
.date-slider-container::-webkit-scrollbar-thumb {
    background: #ccc; /* 스크롤바 색상 */
    border-radius: 4px;
}
.date-btn {
    display: inline-block; /* 가로로 나열 */
    padding: 8px 15px; /* 버튼 내부 여백 */
    margin-right: 8px; /* 버튼 간 간격 */
    border: 1px solid #ddd;
    border-radius: 20px; /* 둥근 버튼 */
    background-color: white;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.date-btn:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}
.date-btn.active { /* 현재 선택된 날짜 버튼 */
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.time-slots-container {
    margin-top: 20px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.slot {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer; /* 기본적으로 클릭 가능 표시 */
    transition: background-color 0.2s, border-color 0.2s; /* border-color도 추가 */
    position: relative; /* 내부 버튼의 position을 위해 (선택적) */
}
.button-disabled {
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
}
/* 일반 상태 */
.slot.available {
    background-color: #c8e6c9; /* 연한 녹색 */
    color: #1b5e20;
}
.slot.available:hover {
    background-color: #a5d6a7; /* 호버 시 약간 진하게 */
}

/* 예약 불가능 상태들 */
.slot.booking_closed {
    background-color: #f5f5f5; /* 'past'와 유사하게 또는 다른 색상 */
    color: #757575;
    text-decoration: line-through;
    pointer-events: none;
    opacity: 0.6;
}
.slot.booked,
.slot.past {
    text-decoration: line-through; /* 취소선 */
    opacity: 0.7;
    cursor: not-allowed; /* 클릭 불가 커서 */
    pointer-events: none; /* 기본적으로 클릭 이벤트 막기 */
}
.slot.booked { /* 예약 마감 (타인) */
    background-color: #ffcdd2; /* 연한 빨강 */
    color: #b71c1c;
}
.slot.past { /* 지난 시간 */
    background-color: #eeeeee; /* 연한 회색 */
    color: #757575;
}

/* 자신의 예약일 때의 스타일 (다른 상태보다 우선 적용되어야 함) */
.slot.my-booking { /* .my-booking 클래스가 있으면 무조건 적용 */
    border: 2px solid #007bff !important; /* 파란색 테두리, 다른 border보다 우선 */
    background-color: #e7f3fe !important; /* 연한 파란색 배경, 다른 배경보다 우선 */
    color: #004085 !important; /* 글자색도 변경 */
    text-decoration: none !important; /* 취소선 제거 */
    opacity: 1 !important; /* 더 선명하게 */
    cursor: default !important; /* 기본 커서 (내부 버튼이 있으므로) */
    pointer-events: auto !important; /* ★★★ 가장 중요: 클릭 이벤트 허용 ★★★ */
}

/* 자신의 예약 내부의 취소 버튼 */
.slot.my-booking form { /* 폼 자체에 대한 스타일링 (선택적) */
    margin-top: 5px;
}
.slot.my-booking button,
.slot.my-booking input[type="submit"] { /* 버튼 스타일 명시적으로 */
    padding: 3px 8px; /* 버튼 크기 조절 */
    font-size: 0.75em;
    line-height: 1.2;
    background-color: #dc3545; /* 빨간색 계열 */
    border-color: #dc3545;
    color: white;
    pointer-events: auto !important; /* ★★★ 버튼 자체도 클릭 가능하도록 ★★★ */
    cursor: pointer !important; /* 버튼 위에서는 클릭 커서 */
    opacity: 1 !important; /* 버튼은 선명하게 */
}
.slot.my-booking button:hover,
.slot.my-booking input[type="submit"]:hover {
    background-color: #c82333;
    border-color: #bd2130;
}
.slot.unavailable_block {
    background-color: #fff3e0; /* 연한 주황색 또는 다른 색상 */
    color: #e65100;
    text-decoration: line-through;
    pointer-events: none;
    opacity: 0.8;
}

/* web_pro_schedule_manage.html */
.schedule-container { display: flex; gap: 20px; flex-wrap: wrap; } /* 반응형 위해 wrap 추가 */
.schedule-form-view { flex: 1 1 300px; /* 기본 너비, 늘어날 수 있음 */ background: #fff; padding: 20px; border-radius: 5px; margin-bottom:20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);}
.schedule-calendar-view { flex: 2 1 500px; /* 기본 너비, 늘어날 수 있음 */ }
.schedule-list { list-style: none; padding: 0; }
.schedule-item { background-color: #f9f9f9; border: 1px solid #eee; padding: 10px; margin-bottom: 10px; border-radius: 4px; }
.schedule-item strong { color: #007bff; }
.day-schedule { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed #ccc; }
.day-schedule h4 { margin-top: 0; font-size: 1.1em; } /* h3 -> h4로 변경했었음 */

/* === 입력 필드 공통 스타일 === */
/* .login-container .form-group ... 와 같이 부모 선택자를 명시하는 것이 더 안전할 수 있습니다. */
.form-group input[type="text"],
.form-group input[type="tel"],  /* <--- 오타 수정! */
.form-group input[type="password"],
.form-group select.form-select { /* select에도 클래스 지정 권장 */
    width: 100%; /* calc(100% - 20px) 대신 100% 사용 후 box-sizing */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* ★★★ 추가: 크기 계산 일관성 ★★★ */
    line-height: 1.5; /* 추가: 높이 일관성 */
    height: 38px; 

/* height를 명시적으로 고정하고 싶다면 (모든 타입에 동일하게) */
/*
.login-container .form-group input[type="text"],
.login-container .form-group input[type="tel"],
.login-container .form-group input[type="password"] {
    height: 40px !important; 
}
.login-container .form-group select.form-select {
    height: 40px !important;
}
*/



/* 포커스 시 스타일 */
.login-container .form-group input[type="text"],
.login-container .form-group input[type="tel"],
.login-container .form-group input[type="password"] {
    height: 40px !important; 
}
.login-container .form-group select.form-select {
    height: 40px !important;
}

/* Select 태그에 대한 추가 스타일 */
.login-container .form-group select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* 플레이스홀더 스타일 */
.login-container .form-group input::placeholder { /* 좀 더 구체적인 선택자 */
    color: #6c757d;
    opacity: 1;
}



.top-nav {
            background-color: #2c3e50;
            padding: 0.8rem 1rem;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative; /* 드롭다운 기준점 */
        }
        .top-nav .brand a {
            color: white; text-decoration: none;
            font-size: 1.2em; font-weight: bold;
        }

        /* --- 데스크탑용 네비게이션 --- */
        .nav-links-desktop {
            display: none; /* 기본 숨김 */
            align-items: center;
        }
        .nav-links-desktop a, .nav-links-desktop .user-info {
            color: #f8f9fa; margin-left: 15px; text-decoration: none;
            font-weight: 500;
        }
        .nav-links-desktop .user-info { font-size: 0.9em; color: #adb5bd; }

        /* --- 모바일용 항상 보이는 링크 + 토글 버튼 컨테이너 --- */
        .nav-mobile-controls {
            display: flex; /* 기본적으로 모바일에서 보이도록 설정 */
            align-items: center;
        }
        .nav-mobile-visible-link a { /* 모바일에서 항상 보이는 링크 스타일 */
            color: white;
            text-decoration: none;
            margin-right: 10px; /* 햄버거 버튼과의 간격 */
            font-weight: 500;
        }
        .nav-toggle-btn {
            background: none; border: none; color: white;
            font-size: 1.5rem; cursor: pointer; padding: 5px;
            display: block; /* 모바일에서 항상 보이도록 */
        }

        /* --- 모바일용 드롭다운 메뉴 --- */
        .nav-links-mobile-dropdown {
            display: none;
            position: absolute;
            top: 100%; right: 0;
            background-color: #343a40;
            border: 1px solid #454d55; border-top: none;
            border-radius: 0 0 0 5px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            z-index: 1000; min-width: 180px;
        }
        .nav-links-mobile-dropdown.active { display: block; }
        .nav-links-mobile-dropdown a, .nav-links-mobile-dropdown .user-info-mobile {
            display: block; padding: 12px 15px; color: #f8f9fa;
            text-decoration: none; border-bottom: 1px solid #454d55;
            font-size: 0.95rem;
        }
        .nav-links-mobile-dropdown a:last-child { border-bottom: none; }
        .nav-links-mobile-dropdown a:hover { background-color: #495057; }
        .nav-links-mobile-dropdown .user-info-mobile { font-style: italic; color: #adb5bd; }

        /* --- 미디어 쿼리 --- */
        @media (min-width: 880px) { /* 브레이크포인트 조절 필요 */
            .nav-links-desktop { display: flex; }
            .nav-mobile-controls { display: none; } /* 데스크탑에서 모바일 컨트롤 숨김 */
            .nav-links-mobile-dropdown { display: none !important; } /* 데스크탑에서 모바일 메뉴 항상 숨김 */
        }
        /* 메인 컨텐츠 영역 및 푸터 스타일 (style.css에서 관리 권장) */
        body { margin:0; font-family: sans-serif; background-color: #f8f9fa; display:flex; flex-direction:column; min-height:100vh; }
        .main-content-area { flex-grow:1; padding:20px; max-width:1200px; width:100%; margin:0 auto; box-sizing:border-box;}
        footer { text-align:center; padding:20px; font-size:0.8em; color:#777; border-top:1px solid #eee; background-color:#f1f1f1;}
    }