/* Variables converted to CSS custom properties */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f1f5f9;
    --accent-color: #10b981;
    --text-color: #1f2937;
    --light-text: #6b7280;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #3b82f6;
    --gradient-end: #1d4ed8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8fafc;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 2rem 0 1rem 0;
}

.header-top {
    text-align: center;
    margin-bottom: 2rem;
}

.header-top h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-top p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 내비게이션 바 */
.tax-navigation {
    margin-top: 1rem;
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    max-width: 200px;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: white;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-link.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-link.disabled:hover {
    transform: none;
}

.coming-soon {
    font-size: 0.75rem;
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Main content */
main {
    padding: 2rem 0;
}

/* Calculator section */
.calculator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.calculator-card,
.result-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.calculator-card h2,
.calculator-card h3,
.result-card h2,
.result-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Radio group styles */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.radio-group span {
    user-select: none;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--light-text);
}

.discount-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.discount-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.checkbox-group span {
    font-weight: normal;
}

.discount-section-group {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.discount-section-group h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.discount-section-group .checkbox-group {
    margin-bottom: 0.5rem;
}

/* 비활성화된 체크박스/라디오 스타일 */
input[type="checkbox"]:disabled + span,
input[type="radio"]:disabled + span {
    color: var(--light-text);
    text-decoration: line-through;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    opacity: 0.5;
}

/* 종료된 혜택 스타일 */
.checkbox-group.ended span {
    color: #ef4444;
    text-decoration: line-through;
}

.checkbox-group.ended input[type="checkbox"],
.checkbox-group.ended input[type="radio"] {
    opacity: 0.5;
}

.calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

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

/* Result card */
.result-card {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.result-card.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-item.total {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 1rem;
    padding-top: 1rem;
}

/* 결과 섹션 스타일 */
.result-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.result-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.result-section .result-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

/* 하위 항목 스타일 */
.sub-item {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-left: 1rem;
}

.sub-item span:first-child {
    font-style: italic;
}

/* 순수 차량 가격 스타일 */
.pure-price {
    background-color: #f3e5f5;
    border: 2px solid #8e24aa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    font-weight: 600;
    color: #7b1fa2;
}

/* 과세표준 스타일 */
.tax-base {
    background-color: #e1f5fe;
    border: 2px solid #0288d1;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    font-weight: 600;
    color: #0277bd;
}

/* 계산 공식 스타일 */
.calculation-formula {
    font-size: 0.85rem;
    color: var(--light-text);
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f1f5f9;
    border-radius: 4px;
    border-left: 3px solid var(--accent-color);
}

.save-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #0d9488;
}

/* Saved vehicles section */
.saved-vehicles {
    margin-bottom: 3rem;
}

.saved-vehicles h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-color);
}

.vehicle-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.vehicle-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.vehicle-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.vehicle-details {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.vehicle-taxes {
    font-size: 0.9rem;
}

.tax-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.total-tax {
    font-weight: 600;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.vehicle-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.vehicle-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-btn {
    background: var(--primary-color);
    color: white;
}

.load-btn:hover {
    background: #1d4ed8;
}

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

.delete-btn:hover {
    background: #dc2626;
}

/* Tax info section */
.tax-info h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card p {
    color: var(--light-text);
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

.info-card li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

footer p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-top h1 {
        font-size: 2rem;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .nav-item {
        max-width: none;
    }
    
    .nav-link {
        flex-direction: row;
        justify-content: center;
        min-height: 50px;
        padding: 0.75rem 1rem;
    }
    
    .coming-soon {
        margin-top: 0;
        margin-left: 0.5rem;
    }
    
    .calculator-section {
        grid-template-columns: 1fr;
    }
    
    .calculator-card,
    .result-card {
        padding: 1.5rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-link {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading state */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--light-text);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* 광고 영역 */
.ad-section {
    margin: 2rem 0;
    padding: 1rem;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ad-section .adsbygoogle {
    margin: 0 auto;
}

/* 모바일에서 광고 여백 조정 */
@media (max-width: 768px) {
    .ad-section {
        margin: 1.5rem 0;
        padding: 0.75rem;
    }
} 