/**
 * Focus Your Goal with AI - 메인 CSS 파일
 */

/* 한 페이지에 모든 콘텐츠 표시를 위한 구성 */
html, body {
    height: 100%;
    overflow: hidden;
}

/* 공통 스타일 */
body {
    background-color: #f8f9fa;
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
    overflow-y: auto;
    padding: 0 5px;
}

.container {
    margin-top: 5px;
    margin-bottom: 5px;
    width: 100%;
    max-width: 1800px; /* 화면을 더 넓게 사용하도록 최대 너비 증가 */
    padding: 0 5px;
}

/* 모달 관련 스타일 */
.modalDiv {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modalBody {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

/* 활동 항목 스타일 */
.role_target1, .role_target2, .physics, .intelligent, .soul, .social, .week_activity,
.act_day_empty, .act_day_enrol, .act_day_finish {
    cursor: pointer;
    padding: 8px !important;
    transition: background-color 0.2s;
}

.role_target1:hover, .role_target2:hover, .physics:hover, .intelligent:hover, .soul:hover, 
.social:hover, .week_activity:hover, .act_day_empty:hover, .act_day_enrol:hover, .act_day_finish:hover {
    background-color: #f0f0f0;
}

.act_day_finish {
    color: #dc3545 !important;
    text-decoration: line-through;
}

.act_day_empty {
    color: #adb5bd;
}

.act_day_enrol {
    color: #212529;
}

/* 네비게이션 버튼 스타일 */
#previous, #next {
    cursor: pointer;
    transition: color 0.2s;
}

#previous:hover, #next:hover {
    color: #e9ecef !important;
}

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

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
}

.table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
}

.table-responsive {
    border-radius: 0 0 0.25rem 0.25rem;
}

/* 폼 요소 스타일 */
textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* 카드 스타일 */
.card {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 0.75rem;
}

/* 카드 헤더 및 테이블 스타일 */
.card-header {
    border-radius: 0.375rem 0.375rem 0 0 !important;
    padding: 0.5rem 0.75rem !important;
}

.card-header h5 {
    margin-bottom: 0;
    font-size: 1rem;
}

/* 반응형 레이아웃 조정 */
/* 대형 화면 (데스크탑) */
@media (min-width: 1200px) {
    .container {
        max-width: 1800px;
        padding: 0 20px;
    }
    
    /* 더 넓은 화면에서 콘텐츠 레이아웃 최적화 */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-lg-3, .col-lg-2, .col-lg-7, .col-md-6, .col-lg-6 {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* 화면 벗결때 각 컬럼 비율 조정 */
    .col-lg-3 {
        flex: 0 0 20%;
        max-width: 20%;
    }
    
    .col-lg-2 {
        flex: 0 0 15%;
        max-width: 15%;
    }
    
    .col-lg-7 {
        flex: 0 0 65%;
        max-width: 65%;
    }
}

/* 초대형 화면 */
@media (min-width: 1800px) {
    .container {
        max-width: 1920px;
    }
}

/* 중간 화면 (태블릿) */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .col-lg-3, .col-lg-2, .col-lg-7 {
        margin-bottom: 20px;
    }
}

/* 모바일 화면 */
@media (max-width: 767px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .col-lg-3, .col-lg-2, .col-lg-7 {
        margin-bottom: 20px;
    }
    
    .modalBody {
        width: 95%;
        padding: 20px;
        max-height: 80vh;
    }
    
    /* 모바일에서 텍스트 크기 최적화 */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* 모바일에서 테이블 스크롤 가능하도록 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 알림 스타일 */
.alert {
    border-radius: 0.5rem;
}

/* 버튼 스타일 */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

/* 푸터 스타일 */
.footer {
    margin-top: 0;
    padding: 0.25rem 0;
    color: #6c757d;
    font-size: 0.75rem;
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* 추가 반응형 UI 개선 */
.main-content {
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 내비게이션 개선 */
.navbar {
    padding: 0.4rem 1rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

/* 사용성 개선을 위한 호버 효과 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.3s ease;
}

.nav-link:hover:before {
    width: 100%;
}

/* 테이블 반응형 개선 */
@media (max-width: 767px) {
    .table.table-sm {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    /* 모바일에서 레이블 및 입력창 */
    .form-label {
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    /* 모바일에서 일일 활동 테이블 */
    #thisweek_activity-mobile td, #thisweek_activity-mobile-hour td {
        padding: 10px; 
    }
    
    #thisweek_activity-mobile strong, #thisweek_activity-mobile-hour strong {
        display: block;
        margin-bottom: 5px;
        font-size: 0.85rem;
        color: #495057;
    }
    
    /* 일일 활동 요소 감싸기 */
    .act_day_empty, .act_day_enrol, .act_day_finish {
        padding: 8px 5px;
        margin-top: 5px;
        border-left: 3px solid #dee2e6;
        background-color: #f8f9fa;
        border-radius: 0.25rem;
        transition: all 0.2s ease;
    }
    
    .act_day_empty {
        border-left-color: #adb5bd;
    }
    
    .act_day_enrol {
        border-left-color: #0d6efd;
    }
    
    .act_day_finish {
        border-left-color: #dc3545;
    }
    
    /* 역할 지정 */
    .week_activity {
        position: relative;
        padding-left: 10px !important;
    }
    
    .week_activity span {
        display: block;
        margin-top: 3px;
    }
}

/* 모바일 화면에서의 탭 스타일 */
.nav-pills .nav-link {
    border-radius: 0.25rem;
    margin: 0 2px;
    font-size: 0.9rem;
    padding: 0.5rem 0.3rem;
    text-align: center;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
}

/* 모바일 용 일별 날짜 선택기 */
#current-day {
    font-weight: bold;
    font-size: 1.1rem;
    flex-grow: 1;
}

/* 모바일용 버튼 그룹 */
.btn-group-mobile {
    margin-bottom: 15px;
}

/* 테이블 스크롤 힌트 */
.scroll-hint {
    position: relative;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0 0 0.25rem 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    transition: opacity 0.5s ease;
}

.scroll-hint i {
    animation: scrollHint 1.5s infinite;
    display: inline-block;
}

@keyframes scrollHint {
    0% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    100% { transform: translateX(-5px); }
}

/* 모바일용 터치 피드백 개선 */
.role_target1:active, .role_target2:active, .physics:active, .intelligent:active, .soul:active, 
.social:active, .week_activity:active, .act_day_empty:active, .act_day_enrol:active, .act_day_finish:active {
    background-color: #e9ecef;
}

/* 모바일 화면에서 추가 스타일 */
@media (max-width: 767px) {
    /* 모바일에서 탭 네비게이션 */
    .nav-pills {
        background-color: #f8f9fa;
        border-radius: 0.5rem;
        padding: 3px;
        margin-bottom: 15px;
    }
    
    /* 모바일에서 탭 콘텐츠 */
    .tab-content {
        padding-top: 10px;
    }
    
    /* 모바일에서 날짜 네비게이션 */
    #prev-day, #next-day {
        line-height: 1;
        padding: 0.25rem 0.5rem;
    }
    
    #current-day {
        padding: 0.25rem 0;
    }
    
    /* 주간 날짜 선택기 */
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 상단으로 가는 버튼 */
    #scroll-to-top {
        position: fixed;
        bottom: 15px;
        right: 15px;
        z-index: 1000;
        opacity: 0.8;
        padding: 0.25rem 0.75rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .card {
        margin-bottom: 15px;
    }
}

/* 캐러셀 활성화 효과 (모바일용 일별 네비게이션) */
.mobile-day-view {
    transition: opacity 0.3s ease-in-out;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}
