/* ===========================
   Global Styles & Reset
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

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

/* ===========================
   Header & Navigation
   =========================== */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
}

.logo span {
    color: var(--secondary-color);
}

nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

nav a:hover {
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.1);
}

/* ===========================
   Advertisement Containers
   =========================== */
.ad-container {
    margin: 2rem auto;
    text-align: center;
}

.ad-placeholder {
    background: var(--bg-white);
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-demo {
    color: var(--text-light);
}

.ad-demo p {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ad-demo small {
    display: block;
    font-size: 0.875rem;
}

.ad-banner-top,
.ad-banner-middle,
.ad-banner-bottom {
    max-width: 728px;
}

/* Sidebar Ads */
.ad-sidebar {
    position: fixed;
    top: 150px;
    width: 160px;
    z-index: 100;
}

.ad-sidebar-left {
    left: 20px;
}

.ad-sidebar-right {
    right: 20px;
}

.ad-sidebar .ad-placeholder {
    min-height: 600px;
    padding: 1rem;
}

/* Hide sidebar ads on smaller screens */
@media (max-width: 1400px) {
    .ad-sidebar {
        display: none;
    }
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Free Badge Container */
.free-badge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.badge i {
    font-size: 1rem;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.badge-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

/* ===========================
   Converter Card
   =========================== */
.converter-card {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.currency-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currency-input-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.input-with-currency {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-with-currency input {
    padding: 0.875rem 1rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.input-with-currency input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.currency-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.swap-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.swap-btn:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.rate-info {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rate-info i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.rate-info span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.rate-info small {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-left: auto;
}

.convert-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.convert-btn i {
    margin-right: 0.5rem;
}

/* ===========================
   Popular Conversions Section
   =========================== */
.popular-section {
    padding: 3rem 0;
}

.popular-section h3 {
    font-size: 1.875rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.popular-section h3 i {
    color: var(--danger-color);
    margin-right: 0.5rem;
}

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

.popular-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.popular-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.popular-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.currency-pair {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.currency-flags {
    display: flex;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.popular-rate {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.rate-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.rate-change.positive {
    color: var(--secondary-color);
    background: rgba(16, 185, 129, 0.1);
}

.rate-change.negative {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 120px;
}

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

/* ===========================
   Exchange Rates Table
   =========================== */
.rates-section {
    padding: 3rem 0;
}

.rates-section h3 {
    font-size: 1.875rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.rates-section h3 i {
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

.rates-table-container {
    background: var(--bg-white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
}

.rates-table thead {
    background: var(--bg-light);
}

.rates-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.rates-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.rates-table tbody tr:hover {
    background: var(--bg-light);
}

.rates-table .currency-name {
    font-weight: 600;
    color: var(--text-dark);
}

.rates-table .currency-code {
    color: var(--text-light);
    font-size: 0.875rem;
}

.rates-table .loading {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* ===========================
   Info Section
   =========================== */
.info-section {
    padding: 3rem 0;
}

.info-section h3 {
    font-size: 1.875rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-section h3 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

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

.info-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h4 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.info-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===========================
   FAQ Section
   =========================== */
.faq-section {
    padding: 3rem 0;
}

.faq-section h3 {
    font-size: 1.875rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-section h3 i {
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

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

.faq-item {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.faq-item h4 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===========================
   Footer
   =========================== */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #9ca3af;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

.footer-bottom a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--secondary-color);
}

.disclaimer {
    font-size: 0.875rem;
    font-style: italic;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.875rem;
    }

    .free-badge-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .badge {
        font-size: 0.8125rem;
        padding: 0.4rem 0.875rem;
    }

    .converter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swap-btn {
        transform: rotate(90deg);
        justify-self: center;
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }

    .converter-card {
        padding: 1.5rem;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .rate-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .rate-info small {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .input-with-currency input {
        font-size: 1rem;
    }

    .popular-section h3,
    .rates-section h3,
    .info-section h3,
    .faq-section h3 {
        font-size: 1.5rem;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    header,
    .ad-container,
    .ad-sidebar,
    footer {
        display: none;
    }
}
