/* 시차 계산기 (Timezone Converter) */

/* 현재 시간 헤더 */
.current-time-header {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--bg-primary);
}

.current-time-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.current-date-display {
    font-size: 1.1rem;
    opacity: 0.9;
}

.current-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 타임라인 슬라이더 섹션 */
.timeline-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 6px;
}

.timeline-container {
    position: relative;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.timeline-container:active {
    cursor: grabbing;
}

/* 업무시간 시각화 배경 */
.timeline-hours {
    display: flex;
    height: 100%;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

.timeline-hour {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    transition: background 0.2s;
}

.timeline-hour:last-child {
    border-right: none;
}

/* 업무시간 색상 */
.timeline-hour.work-hours {
    background: rgba(34, 197, 94, 0.15);
}

.timeline-hour.early-late {
    background: rgba(250, 204, 21, 0.15);
}

.timeline-hour.night {
    background: rgba(239, 68, 68, 0.1);
}

/* 현재 시간 인디케이터 */
.timeline-indicator {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    z-index: 10;
    transition: left 0.1s ease-out;
}

.timeline-indicator::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* 시간 직접 입력 */
.time-input-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
    justify-content: center;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.time-input {
    width: 140px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.time-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.reset-time-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reset-time-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* 도시 추가 섹션 */
.city-add-section {
    margin-bottom: 24px;
}

.city-search-wrapper {
    position: relative;
}

.city-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.city-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.city-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.city-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: none;
}

.city-search-results.active {
    display: block;
}

.city-search-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.city-search-item:last-child {
    border-bottom: none;
}

.city-search-item:hover {
    background: #252542;
}

.city-search-item-name {
    font-weight: 500;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 국기 이모지 스타일 */
.city-flag {
    font-size: 1.1em;
    line-height: 1;
}

.city-search-item-info {
    font-size: 0.8rem;
    color: #a0a0b0;
}

/* 인기 도시 퀵버튼 - 큰 버튼 스타일 */
.popular-cities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.popular-city-btn {
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.popular-city-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(184, 134, 11, 0.1) 100%);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.popular-city-btn .city-flag {
    font-size: 1.2em;
}

/* 도시 시간 카드 그리드 */
.city-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* 도시 시간 카드 */
.city-time-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.2s;
}

.city-time-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
    transform: translateY(-2px);
}

.city-time-card.is-local {
    border: 2px solid var(--accent-primary);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1), 0 8px 24px rgba(212, 175, 55, 0.15);
    position: relative;
}

.city-time-card.is-local::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 12px 12px 0 0;
}

.city-time-card.is-local .city-name {
    color: var(--accent-primary);
}

.city-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.city-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.city-country {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.city-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.city-remove-btn:hover {
    background: #ef4444;
    color: white;
}

.city-time-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.city-date-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.city-date-display .date-diff {
    color: var(--accent-primary);
    font-weight: 600;
}

/* 시간대 정보 배지 */
.timezone-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timezone-badge {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timezone-badge.utc-offset {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-primary);
}

/* 시차 표시 배지 */
.timezone-badge.time-diff {
    font-weight: 600;
    padding: 4px 12px;
}

.timezone-badge.time-diff.diff-positive {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.timezone-badge.time-diff.diff-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.timezone-badge.time-diff.diff-same {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

/* 업무시간 인디케이터 */
.work-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.work-status.working {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.work-status.early-late {
    background: rgba(250, 204, 21, 0.15);
    color: #ca8a04;
}

.work-status.off-hours {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.work-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* 즐겨찾기/프리셋 섹션 */
.presets-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.presets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.presets-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-preset-btn {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.save-preset-btn:hover {
    background: var(--accent-secondary);
}

.presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-item:hover {
    border-color: var(--accent-primary);
}

.preset-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.preset-cities {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preset-delete-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.preset-delete-btn:hover {
    background: #ef4444;
    color: white;
}

.presets-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* URL 공유 섹션 */
.share-section {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.share-copy-btn {
    padding: 12px 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: var(--accent-secondary);
}

/* 회의 최적 시간 (향후 확장용) */
.meeting-time-section {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, var(--bg-secondary) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.meeting-time-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.meeting-time-icon {
    width: 36px;
    height: 36px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.meeting-time-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.meeting-time-result {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.meeting-time-range {
    font-weight: 600;
    color: #22c55e;
}

/* DST 알림 */
.dst-notice {
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #ca8a04;
}

.dst-notice i {
    font-size: 1.1rem;
}

/* 12h/24h 토글 */
.time-format-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
}

.time-format-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.time-format-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* 반응형 */
@media (max-width: 768px) {
    .current-time-display {
        font-size: 2.2rem;
    }

    .city-cards-grid {
        grid-template-columns: 1fr;
    }

    .city-time-display {
        font-size: 2rem;
    }

    .time-input-row {
        flex-direction: column;
    }

    .share-section {
        flex-direction: column;
    }

    .timeline-hour {
        font-size: 0.55rem;
    }

    .popular-cities {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .current-time-header {
        padding: 16px;
    }

    .current-time-display {
        font-size: 1.8rem;
    }

    .city-time-card {
        padding: 16px;
    }

    .city-time-display {
        font-size: 1.8rem;
    }

    .presets-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
