/* 지역아동센터 학습관리 시스템 - 모던 블루 테마 */

/* 전역 변수 */
:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --secondary-blue: #1e40af;
    --accent-blue: #60a5fa;
    --light-blue: #dbeafe;
    --background-gray: #f8fafc;
    --sidebar-width: 220px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 개발 브랜치용 테마 - 제거됨 */


/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-gray);
    color: #374151;
    line-height: 1.6;
}

/* 사이드바 스타일 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-brand h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.sidebar-brand p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
    margin-top: 0.25rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-right: 3px solid white;
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 메인 컨텐츠 영역 */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
}

.top-navbar {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-blue);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    color: var(--primary-blue);
    font-weight: 600;
}

.content-area {
    padding: 2rem;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: none;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 1.5rem 1rem;
    border-radius: 12px 12px 0 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* 통계 카드 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-blue);
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-weight: 500;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--accent-blue);
    opacity: 0.8;
}

.stat-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 버튼 스타일 */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--secondary-blue));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
}

.quick-action-btn {
    background: white;
    border: 2px solid var(--light-blue);
    color: var(--primary-blue);
    padding: 1.5rem;
    text-align: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    height: 100%;
    min-height: 120px;
}

.quick-action-btn:hover {
    border-color: var(--primary-blue);
    background: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    color: var(--primary-blue-dark);
    text-decoration: none;
}

.quick-action-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--accent-blue);
}

/* 테이블 스타일 */
.table {
    margin: 0;
}

.table thead th {
    background: var(--background-gray);
    color: #374151;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody td {
    padding: 1rem 0.75rem;
    border-color: #e5e7eb;
    color: #374151;
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* 배지 스타일 */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* 로그인 페이지 */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.login-brand h2 {
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-brand p {
    color: #6b7280;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group {
    position: relative;
}

.input-group-text {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 10;
}

.input-group .form-control {
    padding-left: 3rem;
}

/* 알림 스타일 */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: var(--light-blue);
    color: var(--secondary-blue);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .content-area {
        padding: 1rem;
        margin-top: 60px; /* 모바일 토글 버튼을 위한 여백 */
    }
    
    .top-navbar {
        padding: 1rem;
        margin-left: 50px; /* 토글 버튼 공간 확보 */
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .login-card {
        padding: 2rem;
        margin: 1rem;
        max-width: 100%;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .user-info {
        font-size: 0.875rem;
    }
    
    .user-info span:first-of-type {
        display: none; /* 모바일에서 사용자 이름 숨김 */
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .quick-action-btn {
        min-height: 80px;
        padding: 0.75rem;
    }
    
    .quick-action-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .top-navbar {
        margin-left: 45px;
        padding: 0.75rem 1rem;
    }
    
    .content-area {
        margin-top: 50px;
        padding: 0.75rem;
    }
    
    .user-menu .dropdown {
        display: none; /* 아주 작은 화면에서 드롭다운 숨김 */
    }
    
    /* 통계 카드를 2개씩 배치 */
    .stat-card {
        font-size: 0.9rem;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 로딩 상태 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 특수 효과 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 독서 상태 버튼 스타일 개선 */
.reading-status-btn {
    transition: all 0.2s ease;
    border-width: 2px !important;
}

.reading-status-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.reading-status-btn.active {
    border-width: 3px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.reading-status-btn.btn-secondary.active {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.reading-status-btn.btn-outline-secondary {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.reading-status-btn.btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

/* ===== 반응형 사이드바 토글 시스템 ===== */

/* 햄버거 메뉴 버튼 */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1060;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-blue-dark);
    transform: scale(1.05);
}

.sidebar-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* 사이드바 오버레이 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* 태블릿 및 모바일 반응형 스타일 */
@media (max-width: 991.98px) {
    /* 사이드바를 오버레이 모드로 변경 */
    .sidebar {
        position: fixed;
        top: 0;
        left: -220px; /* 숨김 상태 */
        width: 220px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        left: 0; /* 표시 상태 */
    }
    
    /* 메인 콘텐츠 영역을 전체 너비로 확장 */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* 페이지 제목에 왼쪽 여백 추가 (햄버거 버튼 공간 확보) */
    .page-title {
        margin-left: 80px;
    }
}

/* 모바일 최적화 */
@media (max-width: 576px) {
    .sidebar-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        top: 15px;
        left: 15px;
    }
    
    .sidebar {
        width: 200px;
        left: -200px;
    }
    
    .page-title {
        margin-left: 70px;
        font-size: 1.5rem;
    }
}

/* 데스크톱에서는 햄버거 버튼 숨김 */
@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* ===== 태블릿 최적화 (768px ~ 1200px) ===== */

@media (max-width: 1200px) and (min-width: 768px) {
    /* 주간 포인트 현황 섹션 최적화 */
    .card-body .row .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* d-flex 컨테이너 최적화 */
    .card-body .row .col-md-3 .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
    }
    
    /* 아이콘과 텍스트 분리 */
    .card-body .row .col-md-3 .d-flex .me-3 {
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
        align-self: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* 아이콘 원형 배경 최적화 */
    .card-body .row .col-md-3 .d-flex .me-3 .rounded-circle {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
    }
    
    /* 텍스트 영역 최적화 */
    .card-body .row .col-md-3 .d-flex > div:last-child {
        width: 100% !important;
        flex: 1 !important;
    }
    
    /* "평균 포인트" 텍스트 줄바꿈 방지 */
    .card-body .row .col-md-3 .text-muted.small {
        white-space: nowrap !important;
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
        overflow: visible !important;
    }
    
    /* 과목명 최적화 */
    .card-body .row .col-md-3 .fw-bold {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
}

/* ===== 검색 입력창 최적화 ===== */

/* input-group 텍스트가 아이콘에 가려지지 않도록 패딩 조정 */
.input-group .form-control {
    padding-left: 4rem !important;
}

/* input-group-text 아이콘 크기 조정 */
.input-group-text {
    width: 2.5rem !important;
    justify-content: center !important;
    align-items: center !important;
} 
