﻿/* ===================================
   길이 변환기 - 개선된 디자인
   =================================== */

:root {
    --primary-color: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #38BDF8;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --danger-color: #EF4444;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #EFF6FF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    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, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main */
.main {
    padding: 60px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 60px;
}

.hero-section h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Converter Section */
.converter-section {
    margin-bottom: 40px;
}

.converter-card {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.converter-card:hover {
    box-shadow: var(--shadow-xl);
}

/* Input Group */
.input-group {
    margin-bottom: 28px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-field::placeholder {
    color: var(--text-light);
}

/* Select Group */
.select-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 28px;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.select-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-field {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.select-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.select-field::-webkit-scrollbar {
    width: 8px;
}

.select-field::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.select-field::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.select-field::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.arrow-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    color: var(--primary-color);
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border-light);
    animation: slideUp 0.5s ease-out;
}

.result-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border-light);
    animation: slideUp 0.5s ease-out;
    text-align: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.result-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    margin: 16px 0 8px 0;
}

.result-unit {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info Section */
.info-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 20px;
    padding: 50px 40px;
    border: 1px solid var(--border-light);
    margin-bottom: 40px;
}

.info-section h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 18px;
    font-weight: 700;
}

.info-section h2:first-of-type {
    margin-top: 0;
}

.info-section p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-size: 15px;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section ul li {
    padding: 12px 0 12px 32px;
    position: relative;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 15px;
}

.info-section ul li::before {
    content: "";
    position: absolute;
    left: 0;
    font-size: 18px;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Footer */
.footer {
    margin-top: 60px;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 36px;
    }

    .select-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .arrow-icon {
        display: none;
    }

    .converter-card {
        padding: 28px;
    }

    .result-display {
        padding: 24px;
    }

    .result-value {
        font-size: 24px;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 28px;
    }

    .converter-card {
        padding: 20px;
    }

    .input-field,
    .select-field {
        padding: 12px 14px;
        font-size: 14px;
    }

    .result-value {
        font-size: 20px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-section {
        padding: 24px;
    }

    .info-section h2 {
        font-size: 22px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}
