/* style.css */
:root {
    --primary-color: #0f70c1;
    --secondary-color: #67c2c6;
    --accent-color: #2468a6;
    --light-bg: #f8fbfe;
    --card-shadow: 0 10px 30px rgba(65, 125, 187, 0.12);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #eaf6ff 0%, #dcf1ea 100%);
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
}

.tax-card {
    max-width: 1000px;
    width: 100%;
    border-radius: 20px;
    background: #fff;
    border: none;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.tax-card:hover {
    transform: translateY(-5px);
}

.tax-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.tax-header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
}

.tax-header h1 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    position: relative;
}

.tax-header .subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    opacity: 0.9;
    position: relative;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

.card-body {
    padding: 25px 20px;
}

@media (min-width: 768px) {
    .card-body {
        padding: 35px 30px;
    }
}

.converter-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .converter-container {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

.converter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e1e8f0;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .converter-section {
        padding: 25px;
    }
}

.converter-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .date-inputs {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.input-group input,
.input-group select {
    padding: 12px 15px;
    border: 2px solid #e1e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    width: 100%;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(103, 194, 198, 0.1);
    outline: none;
}

.input-group input.error,
.input-group select.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8em;
    margin-top: 5px;
    display: none;
}

.btn-primary {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-color);
    color: white;
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(15, 112, 193, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Small Result Display under each button */
.result-display-small {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e8f0;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.result-display-small .result-date {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.result-display-small .result-label {
    color: #64748b;
    font-size: 0.8em;
}

.result-placeholder {
    color: #94a3b8;
    font-size: 0.9em;
    font-style: italic;
}

.result-meta {
    margin-top: 10px;
    padding: 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.8em;
}

.leap-year-badge {
    background: var(--success-color);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 6px;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ethiopian-month-names {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e1e8f0;
}

@media (min-width: 768px) {
    .ethiopian-month-names {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .ethiopian-month-names {
        grid-template-columns: repeat(4, 1fr);
    }
}

.month-item {
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 0.9em;
    font-weight: 500;
}

.month-item.current {
    background: var(--primary-color);
    color: white;
}

/* Package Links Section */
.package-links-section {
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

.package-links-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.package-links {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.package-link-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .package-link-group {
        grid-template-columns: 1fr 1fr;
    }
}

.package-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.package-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    text-decoration: none;
}

.package-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.package-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.package-text strong {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.package-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.package-info {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.package-info p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.package-name-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 600;
}

.package-name-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* SEO & Accessibility Improvements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Print styles for better accessibility */
@media print {
    .tax-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .btn-primary,
    .converter-section {
        display: none;
    }

    .result-display-small {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading::after {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #008080;
        --accent-color: #0000ff;
    }
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile-first responsive improvements */
@media (max-width: 375px) {
    body {
        padding: 15px 10px;
    }
    
    .tax-header {
        padding: 25px 15px;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    .converter-section {
        padding: 15px;
    }
    
    .date-inputs {
        gap: 12px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px 12px;
    }
    
    .package-info {
        padding: 15px;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .tax-card {
        max-width: 1100px;
    }
    
    .converter-container {
        gap: 40px;
    }
}