/* Enhanced Walleto Styles */
:root {
    --primary: #FBBF24;
    --secondary: #6B7280;
    --dark: #1F2937;
    --light: #F9FAFB;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
}

/* Loading States & Animations */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Improved Header Styles */
.header-brand {
    font-family: 'Poppins', 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary), #F59E0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-container {
    background: linear-gradient(135deg, var(--primary), #F59E0B);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

/* Enhanced Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #F59E0B);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

.btn-secondary {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Language Buttons Enhancement */
.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #6b7280;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.2), transparent);
    transition: left 0.5s;
}

.lang-btn:hover::before {
    left: 100%;
}

.lang-btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.lang-btn:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
    border-left: none;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.lang-btn:hover:not(.active) {
    background: #f3f4f6;
    border-color: var(--primary);
    color: var(--primary);
}

/* Enhanced Calculator */
.calculator-container {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.calculator-input {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.calculator-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
    outline: none;
}

.calculator-select {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.calculator-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
    outline: none;
}

.calculator-result {
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced Form Validation */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
    outline: none;
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.form-error i {
    margin-right: 0.25rem;
}

/* Enhanced Currency Cards */
.currency-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.currency-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.1), transparent);
    transition: left 0.6s;
}

.currency-card:hover::before {
    left: 100%;
}

.currency-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.currency-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.currency-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), #F59E0B);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: white;
    margin-left: 1rem;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.currency-info {
    flex: 1;
}

.currency-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.currency-code {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.currency-trend {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.currency-trend.positive {
    background: #dcfce7;
    color: #16a34a;
}

.currency-trend.negative {
    background: #fef2f2;
    color: #dc2626;
}

.currency-rate {
    text-align: center;
    margin: 1.5rem 0;
}

.rate-value {
    font-size: 2rem;
    font-weight: 900;
    color: #1a1a1a;
    display: block;
}

.rate-unit {
    color: #6b7280;
    font-size: 0.9rem;
}

.currency-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.action-item {
    padding: 0.75rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.action-item.buy {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.action-item.sell {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.action-item:hover {
    transform: scale(1.05);
}

.action-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.action-item.buy .action-label {
    color: #16a34a;
}

.action-item.sell .action-label {
    color: #dc2626;
}

.action-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .currency-card {
        margin-bottom: 1rem;
    }
    
    .rate-value {
        font-size: 1.6rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .container {
        max-width: 95%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f9fafb;
        --light: #1f2937;
    }
}

/* News Section Styles */
.news-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.news-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-section-title i {
    color: var(--primary);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.news-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.news-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.5rem;
}

.news-title:hover {
    color: var(--primary-600);
    text-decoration: none;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.news-source {
    background: var(--primary);
    color: #1a1a1a;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.news-date {
    font-weight: 500;
}

.news-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

.news-error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-weight: 500;
}

/* Responsive adjustments for news */
@media (max-width: 768px) {
    .news-section {
        padding: 1rem;
    }
    
    .news-item {
        padding: 0.75rem;
    }
    
    .news-title {
        font-size: 0.9rem;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .exchange-rate {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .news-section {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}