/* DJ 셋 타이머 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    padding: 20px;
    transition: font-family 0s;
}

/* 폰트 로딩 완료 후 Inter 적용 */
body.fonts-loaded {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.fonts-loaded .export-btn,
body.fonts-loaded .snapshot-btn,
body.fonts-loaded .clear-btn {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.fonts-loaded .credit-link {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
}

.header {
    background: linear-gradient(135deg, #333333 0%, #2d3436 100%);
    color: #ffffff;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}/* 언어 선택기 스타일 */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a1a;
    border: 2px solid #636e72;
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-option:hover {
    background: #636e72;
}

.language-option.active {
    background: #74b9ff;
    color: white;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.input-section {
    background: #2d3436;
    border-radius: 15px;
    padding: 25px;
}

.input-section h2 {
    color: #ddd;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.input-area {
    width: 100%;
    height: 400px;
    border: 2px solid #636e72;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #ffffff;
}

.input-area::placeholder {
    color: #b2bec3;
}

.input-area:focus {
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.2);
}

.input-help {
    margin-top: 10px;
    font-size: 0.9em;
    color: #b2bec3;
}

.results-section {
    background: #2d3436;
    border-radius: 15px;
    padding: 25px;
}

.results-section h2 {
    color: #ddd;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.total-time {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.total-time h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.total-time .time {
    font-size: 2.2em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.track-list {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #636e72;
}

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

.track-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.track-number {
    font-weight: bold;
    color: #74b9ff;
    min-width: 60px;
}

.track-time {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff;
    min-width: 50px;
}

.track-title {
    color: #b2bec3;
    font-style: italic;
    margin-left: 4px;
}

.no-tracks {
    text-align: center;
    color: #b2bec3;
    font-style: italic;
    padding: 20px;
}.target-time-section {
    background: #636e72;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #74b9ff;
}

.target-time-section h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.1em;
}

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

.target-input-group span {
    color: #ffffff;
    font-weight: bold;
}

.target-input-group input {
    width: 70px;
    padding: 8px;
    border: 2px solid #74b9ff;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    background: #1a1a1a;
    color: #ffffff;
}

.target-input-group input:focus {
    outline: none;
    border-color: #0984e3;
}

.target-input-group button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.target-input-group button:hover {
    transform: translateY(-2px);
}

.time-comparison {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
}

.time-comparison.under {
    background: #e74c3c;
    color: white;
}

.time-comparison.over {
    background: #f39c12;
    color: white;
}

.time-comparison.perfect {
    background: #27ae60;
    color: white;
}

.stats-section {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #b2bec3;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

.track-title {
    font-size: 0.9em;
    color: #74b9ff;
    margin-top: 3px;
    font-style: italic;
}

.track-delete {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.2s;
}

.track-delete:hover {
    background: #c0392b;
}/* 반응형 디자인 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 2em;
        margin-bottom: 8px;
    }
    
    .language-selector {
        position: absolute;
        top: 15px;
        right: 20px;
        margin-bottom: 0;
    }
    
    .language-dropdown {
        position: static;
        transform: none;
        margin-top: 10px;
    }
    
    .input-area {
        height: 300px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .target-input-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .track-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .track-delete {
        align-self: flex-end;
    }
}

/* 스크롤바 스타일 */
.track-list::-webkit-scrollbar {
    width: 8px;
}

.track-list::-webkit-scrollbar-track {
    background: #2d3436;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb {
    background: #636e72;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb:hover {
    background: #74b9ff;
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #74b9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 다크 모드 개선 */
input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Footer Credit 스타일 */
.footer-credit {
    position: absolute !important;
    bottom: 15px !important;
    right: 20px !important;
    z-index: 1000 !important;
    text-align: right !important;
}

.credit-link {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    display: inline-block !important;
}

.credit-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

/* 저장 상태 표시 */
.save-status {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 15px 0 10px 0;
    transition: opacity 0.3s ease;
    opacity: 0.5;
}

/* 내보내기 및 스냅샷 컨트롤 */
.export-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.project-controls {
    display: flex;
    justify-content: center;
}

/* 내보내기 버튼 스타일 */
.export-btn, .snapshot-btn, .clear-btn {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.export-btn:hover, .snapshot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    padding: 10px 20px;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 스냅샷 버튼 특별 스타일 */
.snapshot-btn {
    background: linear-gradient(135deg, #55a3ff 0%, #003d82 100%);
}

.snapshot-btn:hover {
    box-shadow: 0 6px 20px rgba(85, 163, 255, 0.4);
}

/* 프로젝트 관리 UI */
.project-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 모바일 최적화 스타일 */
@media (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
    }
    
    .container {
        margin: 0;
        border-radius: 15px;
        min-height: calc(100vh - 20px);
        display: flex;
        flex-direction: column;
    }
    
    .header {
        padding: 10px 15px;
        text-align: center;
        position: relative;
    }
    
    .header h1 {
        font-size: 1.8em;
        margin-bottom: 6px;
    }
    
    .header p {
        font-size: 0.9em;
        margin-bottom: 0;
    }
    
    .language-selector {
        top: 15px;
        right: 15px;
    }
    
    .language-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0 15px 15px;
        gap: 15px;
    }
    
    .input-section {
        order: 1;
    }
    
    .input-section h2 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .input-area {
        height: 120px;
        font-size: 14px;
        padding: 12px;
    }
    
    .input-help {
        font-size: 11px;
        margin-top: 8px;
    }
    
    .results-section {
        order: 2;
        flex: 1;
    }
    
    .results-section h2 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .target-time-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .target-time-section h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .target-input-group {
        justify-content: center;
        gap: 8px;
    }
    
    .target-input-group input {
        width: 50px;
        padding: 8px;
        font-size: 14px;
    }
    
    .target-input-group button {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .total-time {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .total-time h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .total-time .time {
        font-size: 2em;
    }
    
    .stats-section {
        padding: 12px 15px;
        margin-bottom: 15px;
    }
    
    .stat-item {
        margin-bottom: 8px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .track-list {
        max-height: 200px;
        margin-bottom: 15px;
    }
    
    .track-item {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .track-number {
        font-size: 12px;
    }
    
    .track-time {
        font-size: 13px;
    }
    
    .track-title {
        font-size: 11px;
        margin-top: 3px;
    }
    
    .track-delete {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .save-status {
        font-size: 11px;
        margin: 10px 0;
    }
    
    .export-controls {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .export-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .export-btn, .snapshot-btn {
        padding: 12px 8px;
        font-size: 12px;
        border-radius: 6px;
        justify-content: center;
        align-items: center;
        display: flex;
        gap: 4px;
    }
    
    .project-controls {
        justify-content: center;
    }
    
    .clear-btn {
        padding: 10px 20px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .footer-credit {
        bottom: 10px !important;
        right: 15px !important;
    }
    
    .credit-link {
        font-size: 9px !important;
    }
    
    /* 시간 비교 스타일 모바일 최적화 */
    .time-comparison {
        font-size: 13px;
        padding: 6px 10px;
        margin-top: 8px;
    }
    
    /* 언어 드롭다운 모바일 최적화 */
    .language-dropdown {
        right: 0;
        top: 100%;
        min-width: 120px;
    }
    
    .language-option {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 입력 도움말 개선 */
    .input-help {
        background: rgba(255, 255, 255, 0.05);
        padding: 8px 10px;
        border-radius: 6px;
        border-left: 3px solid #74b9ff;
    }
    
    /* 모바일에서 트랙이 없을 때 메시지 */
    .no-tracks {
        font-size: 12px;
        padding: 15px 10px;
    }
}

/* 더 작은 모바일 화면 (iPhone SE 등) */
@media (max-width: 375px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .export-buttons {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .target-input-group {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .target-input-group input {
        width: 45px;
        font-size: 13px;
    }
    
    .total-time .time {
        font-size: 1.8em;
    }
    
    .track-list {
        max-height: 150px;
    }
}
