/* 기본 리셋 및 폰트 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* 헤더 스타일 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header h1 i {
    margin-right: 10px;
    color: #ffd700;
}

.nav {
    display: flex;
    gap: 10px;
}

/* 버튼 스타일 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: #667eea; /* 캘린더 배경색과 대비되도록 색상 변경 */
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background-color: #667eea;
    color: white;
}

/* 메인 컨텐츠 */
.main {
    padding: 2rem 0;
}

.main .container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* 달력 섹션 */
.calendar-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

.calendar-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.calendar {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
}

.calendar-weekdays div {
    background-color: #f8f9fa;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    background-color: white;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-height: 80px;
    position: relative;
}

.calendar-day:hover {
    background-color: #f8f9fa;
    transform: scale(1.02);
}

.calendar-day.other-month {
    color: #adb5bd;
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    border-color: #2196f3;
    font-weight: bold;
}

.calendar-day.has-trip {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.calendar-day.has-trip::after {
    content: '✈';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    color: #ffc107;
}

/* 출장 목록 섹션 */
.trips-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: fit-content;
}

.trips-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

.trips-section h3 i {
    margin-right: 10px;
    color: #667eea;
}

.trips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trip-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trip-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.trip-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.trip-item p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.modal-header h3 i {
    margin-right: 10px;
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

/* 폼 스타일 */
.trip-form {
    padding: 2rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* 출장 상세 정보 */
.trip-detail {
    padding: 2rem;
}

.trip-detail-item {
    margin-bottom: 1.5rem;
}

.trip-detail-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.trip-detail-item p {
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* 풍선 도움말(툴팁) 스타일 */
.trip-tooltip {
    position: absolute;
    display: none;
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 1010;
    font-size: 14px;
    max-width: 300px;
    white-space: pre-wrap; /* 줄바꿈을 위해 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none; /* 툴팁 위로 마우스 이벤트가 지나가도록 */
}

.trip-tooltip h5 {
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #555;
    font-size: 15px;
}

.trip-tooltip p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* 로딩 스피너 */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .main .container {
        grid-template-columns: 1fr;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 10px 5px;
    }
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }