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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* 모달 */
.modal {
    display: flex;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
    color: #555;
}

.info-text {
    font-size: 0.9em;
    color: #888;
}

.info-text a {
    color: #667eea;
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

#apiKeyInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

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

#saveApiKey {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s;
}

#saveApiKey:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 컨트롤 섹션 */
.controls-section {
    margin-bottom: 30px;
}

.control-group {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.control-group h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.location-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-row label {
    min-width: 150px;
    font-weight: 600;
    color: #555;
}

.input-row input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

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

.primary-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.help-text {
    margin-top: 15px;
    color: #888;
    font-size: 0.9em;
}

/* 지도 */
#map {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 40px;
}

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

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

/* 결과 섹션 */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #667eea;
    margin-bottom: 10px;
}

#locationInfo {
    color: #666;
    font-size: 0.95em;
}

/* 달력 */
.calendar {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.day-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.day-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.day-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.day-date {
    color: #888;
    font-size: 0.95em;
}

.events-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-item {
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
}

.event-item.low-tide {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.event-item.sunrise, .event-item.sunset {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.event-item.overlap {
    background: linear-gradient(135deg, #fff9c4 0%, #ffeb3b 100%);
    border-left: 4px solid #f57f17;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 127, 23, 0.3);
}

.event-item.overlap::before {
    content: '⭐ ';
}

.event-type {
    font-weight: 600;
}

.event-time {
    color: #555;
    font-family: 'Courier New', monospace;
}

.no-events {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 범례 */
.legend {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.legend h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.low-tide {
    background: #2196f3;
}

.legend-color.sunrise-sunset {
    background: #ff9800;
}

.legend-color.overlap {
    background: #ffeb3b;
}

/* 에러 메시지 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin: 20px 0;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 0.9em;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .input-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-row label {
        min-width: auto;
    }

    #map {
        height: 300px;
    }
}

