/* ===========================
   주간 시간표·근무표 생성기 스타일
   =========================== */

/* 페이지 컨테이너 가운데 정렬 */
.page-container {
    padding: 20px;
}

.page-container .container {
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 컨트롤 패널 */
.control-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.time-input,
.interval-select,
.form-input,
.form-select {
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
}

.time-input:focus,
.interval-select:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.time-input:hover,
.interval-select:hover,
.form-input:hover,
.form-select:hover {
    border-color: #cbd5e1;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 시간표 섹션 */
.schedule-section {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.schedule-header h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.schedule-header h2 i {
    color: #3b82f6;
    font-size: 1.4rem;
}

.week-info {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
}

.schedule-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.schedule-table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.schedule-table th.time-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    min-width: 100px;
    font-weight: 700;
}

.schedule-table th.day-header {
    min-width: 120px;
}

.schedule-table td {
    border: 1px solid #e2e8f0;
    padding: 0;
    vertical-align: top;
    height: 70px;
    min-height: 70px;
    background: #ffffff;
}

.schedule-table td.time-cell {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    text-align: center;
    font-weight: 600;
    color: #475569;
    padding: 12px;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #cbd5e1;
    font-size: 0.9rem;
}

.schedule-table td.schedule-cell {
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.schedule-table td.schedule-cell:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.schedule-table td.schedule-cell.filled {
    background: var(--cell-bg, #e0e7ff);
    border-color: var(--cell-border, #3b82f6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.schedule-table td.schedule-cell.filled:hover {
    background: var(--cell-bg-hover, #c7d2fe);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.schedule-table td.schedule-cell.search-match {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5);
    z-index: 1;
}

.schedule-table td.schedule-cell:not(.search-match) {
    opacity: 0.3;
}

.schedule-table:has(.search-match) td.schedule-cell:not(.search-match) {
    opacity: 0.3;
}

.cell-content {
    padding: 10px 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--cell-text, #1e293b);
    word-break: break-word;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    border-radius: 6px;
}

.cell-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.cell-meta {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cell-category {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-size: 0.7rem;
    margin-top: 4px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.cell-priority {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cell-priority.priority-high {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.cell-priority.priority-urgent {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 통계 섹션 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon i {
    font-size: 1.4rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 28px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 1.4rem;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-header h3 i {
    color: #3b82f6;
    font-size: 1.3rem;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
    flex: 1;
}

.modal-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-label {
    font-weight: 600;
    color: #475569;
    min-width: 70px;
    font-size: 0.9rem;
}

.info-value {
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #ffffff;
    color: #1e293b;
    line-height: 1.6;
}

.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.form-textarea:hover {
    border-color: #cbd5e1;
}

.required {
    color: #ef4444;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.color-options {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.color-input {
    width: 56px;
    height: 44px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-input:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.color-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-preset {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.color-preset:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-preset.active {
    border-color: #3b82f6;
    border-width: 3px;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.color-preset.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
}

/* 반응형 */
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    
    .control-panel {
        padding: 24px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .form-input,
    .form-select,
    .time-input,
    .interval-select {
        width: 100%;
        min-width: auto;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .schedule-section {
        padding: 24px;
    }
    
    .schedule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .schedule-table {
        font-size: 0.85rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 10px 6px;
    }
    
    .schedule-table td {
        height: 60px;
        min-height: 60px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 24px;
    }
    
    .color-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ===== FAQ/QNA 섹션 (페이지 하단) ===== */
.faq-section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    margin: 40px auto 0 auto;
    max-width: 900px;
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

.faq-title i {
    color: #2563eb;
    font-size: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.3s ease;
    width: 100%;
}

.faq-item.active,
.faq-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1.6;
    width: 100%;
}

.faq-question span:not(.faq-icon) {
    flex: 1;
    word-break: keep-all;
}

.faq-icon {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.faq-arrow {
    margin-left: auto;
    color: #64748b;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    color: #2563eb;
}

.faq-item .faq-answer {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
    width: 100%;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    margin-bottom: 8px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 24px 20px;
        margin: 24px 0 0;
    }
    
    .faq-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .faq-item {
        padding: 16px 18px;
    }
    
    .faq-question {
        font-size: 1rem;
        gap: 10px;
    }
    
    .faq-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .faq-item .faq-answer {
        font-size: 0.95rem;
    }
}

