* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 28px;
    font-weight: 700;
}

.controls {
    margin-bottom: 30px;
}

.selector-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.selector {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.selector:focus {
    outline: none;
    border-color: #667eea;
}

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

.nav-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

.nav-btn:active {
    transform: scale(0.95);
}

.options-group {
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.pdf-options {
    margin-top: 15px;
}

.seasonal-food-option-wrapper {
    margin-top: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-radius: 10px;
    border: 1px solid #d0e3ff;
}

.seasonal-food-option-wrapper .checkbox-label {
    margin-bottom: 0;
}

.seasonal-food-hint {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    padding-left: 26px;
    line-height: 1.4;
}

.pdf-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.option-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.pdf-selector {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.pdf-selector:focus {
    outline: none;
    border-color: #667eea;
}

/* D-Day 섹션 스타일 */
.dday-section {
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.dday-header {
    margin-bottom: 12px;
}

.dday-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.dday-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.dday-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    min-width: 80px;
}

.dday-date-input {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.dday-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.dday-name-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
}

.dday-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.dday-name-input::placeholder {
    color: #aaa;
}

/* D-Day 색상 선택 */
.dday-color-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 90px;
}

.dday-color-select:focus {
    outline: none;
    border-color: #667eea;
}

/* D-Day 아이템 간격 */
.dday-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.dday-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* D-Day 추가 버튼 */
.dday-add-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.dday-add-btn:hover {
    background: #667eea;
    color: white;
    border-style: solid;
}

/* D-Day 제거 버튼 */
.dday-remove-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #dc3545;
    background: white;
    border: 2px solid #dc3545;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.dday-remove-btn:hover {
    background: #dc3545;
    color: white;
}

/* D-Day 컨테이너 (캘린더 셀 내) */
.dday-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 2px;
}

/* 달력 셀 내 D-Day 라벨 */
.dday-label-cell {
    font-size: 8px;
    font-weight: 600;
    color: white;
    background: #667eea;
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
    display: inline-block;
}

.dday-label-cell.dday-today {
    background: #e74c3c;
}

/* D-Day 당일 기념일 이름 */
.dday-name-label {
    font-size: 7px;
    font-weight: 500;
    color: #e74c3c;
    margin-top: 1px;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* D-Day 목록 섹션 (캘린더 아래) */
.dday-list-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.dday-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.dday-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dday-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.dday-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dday-list-badge {
    font-size: 16px;
    font-weight: 700;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.dday-list-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dday-list-name {
    font-size: 16px;
    font-weight: 600;
}

.dday-list-date {
    font-size: 13px;
    color: #888;
}

/* D-Day 목록 모바일 스타일 */
@media (max-width: 480px) {
    .dday-list-section {
        padding: 15px;
    }

    .dday-list-title {
        font-size: 16px;
    }

    .dday-list-item {
        padding: 12px 15px;
        gap: 12px;
    }

    .dday-list-badge {
        font-size: 14px;
        padding: 6px 12px;
        min-width: 70px;
    }

    .dday-list-name {
        font-size: 14px;
    }

    .dday-list-date {
        font-size: 12px;
    }
}

.calendar {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

.calendar-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
}

.day-header {
    text-align: center;
    padding: 10px 5px;
    font-weight: 700;
    color: #666;
    font-size: 14px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
}

.day-header.sunday {
    color: #e74c3c;
}

.day-header.saturday {
    color: #3498db;
}

.day-cell {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: white;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding: 5px;
    overflow: hidden;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.day-cell.empty {
    background: white;
}

.day-cell.sunday {
    color: #e74c3c;
}

.day-cell.saturday {
    color: #3498db;
}

.day-cell.today {
    background: white;
    font-weight: 700;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
}

.day-cell.today .day-number {
    background: #333;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-cell.holiday {
    color: #e74c3c;
    font-weight: 600;
}

.day-cell.holiday.today {
    background: white;
    color: #e74c3c;
}

.day-cell.holiday.today .day-number {
    background: #e74c3c;
    color: white;
}

.holiday-name {
    font-size: 9px;
    color: #e74c3c;
    margin-top: 2px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.day-cell-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: 100%;
}

.day-number {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.actions {
    text-align: center;
}

.btn-primary {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Footer 스타일 */
.footer {
    margin-top: 30px;
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-separator {
    margin: 0 10px;
    color: white;
    opacity: 0.6;
}

.last-update-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.update-icon {
    font-size: 14px;
}

.update-text {
    font-size: 12px;
    color: white;
    font-weight: 400;
    opacity: 0.9;
}

.update-value {
    font-size: 12px;
    color: white;
    font-weight: 600;
}

.footer-copyright {
    font-size: 12px;
    color: white;
    opacity: 0.8;
}

.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    display: inline-flex;
}

.counter-icon {
    font-size: 16px;
}

.counter-text {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.counter-number {
    font-size: 16px;
    color: white;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.counter-unit {
    font-size: 13px;
    color: white;
    font-weight: 500;
    opacity: 0.9;
}

.last-pdf-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    display: inline-flex;
}

.time-icon {
    font-size: 14px;
}

.time-text {
    font-size: 12px;
    color: white;
    font-weight: 400;
    opacity: 0.9;
}

.time-value {
    font-size: 12px;
    color: white;
    font-weight: 600;
}

/* 제철 음식 섹션 스타일 */
.seasonal-foods-section {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
}

.seasonal-foods-notice {
    background: #f8f8f8;
    color: #333;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

.seasonal-foods-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.seasonal-foods-desc {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.5;
}

.seasonal-foods-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.seasonal-category {
    background: white;
    padding: 15px;
    border: 1px solid #eee;
}

.seasonal-category-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #333;
}

.seasonal-food-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.seasonal-food-item:last-child {
    margin-bottom: 0;
}

.seasonal-food-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 70px;
    flex-shrink: 0;
}

.seasonal-food-reason {
    font-size: 13px;
    color: #555;
    flex: 1;
    line-height: 1.4;
}

.seasonal-food-nutrition {
    font-size: 11px;
    color: #888;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .calendar-header {
        font-size: 20px;
    }

    .day-cell {
        font-size: 14px;
    }

    .day-header {
        font-size: 12px;
        padding: 8px 2px;
    }

    .btn-primary {
        width: 100%;
        padding: 15px;
    }

    /* 제철 음식 모바일 스타일 */
    .seasonal-foods-section {
        padding: 15px;
    }

    .seasonal-foods-notice {
        font-size: 12px;
        padding: 10px 12px;
    }

    .seasonal-foods-title {
        font-size: 17px;
    }

    .seasonal-foods-desc {
        font-size: 12px;
    }

    .seasonal-food-item {
        flex-direction: column;
        gap: 6px;
    }

    .seasonal-food-name {
        font-size: 13px;
    }

    .seasonal-food-reason {
        font-size: 12px;
    }

    .seasonal-food-nutrition {
        align-self: flex-start;
    }

    /* D-Day 모바일 스타일 */
    .dday-item {
        flex-direction: column;
        align-items: stretch;
    }

    .dday-label {
        margin-bottom: 5px;
    }

    .dday-date-input,
    .dday-name-input,
    .dday-color-select {
        width: 100%;
    }
}

/* PDF 달 선택 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.month-selection-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-select {
    padding: 8px 16px;
    font-size: 14px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

.month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.month-item {
    border: 1px solid #ddd;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.month-item:hover {
    border-color: #333;
}

.month-item.selected {
    border-color: #333;
    border-width: 2px;
}

.month-item.selected .month-checkbox {
    background: #333;
    border-color: #333;
}

.month-item.selected .month-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.month-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.month-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.month-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.month-preview {
    padding: 8px;
    font-size: 10px;
}

.month-preview-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}

.month-preview-header {
    font-weight: 600;
    color: #666;
    padding: 2px 0;
    font-size: 8px;
}

.month-preview-header.sunday {
    color: #e74c3c;
}

.month-preview-header.saturday {
    color: #3498db;
}

.month-preview-day {
    padding: 2px 0;
    color: #333;
    font-size: 9px;
}

.month-preview-day.sunday {
    color: #e74c3c;
}

.month-preview-day.saturday {
    color: #3498db;
}

.month-preview-day.empty {
    color: transparent;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.selected-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.modal-footer .btn-primary {
    padding: 12px 32px;
    font-size: 16px;
}

.modal-footer .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 모달 반응형 */
@media (max-width: 768px) {
    .month-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .modal-content {
        max-height: 85vh;
    }

    .month-header {
        padding: 8px 10px;
    }

    .month-name {
        font-size: 12px;
    }

    .month-preview {
        padding: 6px;
    }

    .month-preview-day,
    .month-preview-header {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .month-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .modal-footer .btn-primary {
        width: 100%;
    }
}
