/* ==================== 
   Table of Contents:
   1. CSS Reset & Base Styles
   2. Typography
   3. Color Variables
   4. Layout & Grid
   5. Navigation & Header
   6. Footer
   7. Components (buttons, cards, etc.)
   8. Page-Specific Styles
   9. Media Queries
   ==================== */

/* ====================
   1. CSS Reset & Base Styles
   ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%; /* Makes 1rem = 10px for easier calculations */
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-dark);
}

ul {
    list-style: none;
}

/* ====================
   2. Typography
   ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: var(--heading-color);
}

h1 {
    font-size: 4rem;
}

h2 {
    font-size: 3.2rem;
}

h3 {
    font-size: 2.4rem;
}

h4 {
    font-size: 2rem;
}

p {
    margin-bottom: 1.6rem;
}

.text-center {
    text-align: center;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 4rem;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
}

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ====================
   3. Color Variables 
   ==================== */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #1a1a1a;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666666;
    --accent-color: #2c7be5;
    --accent-dark: #1a5cbf;
    --accent-light: #e8f1fd;
    --success-color: #36b37e;
    --warning-color: #ffab00;
    --error-color: #ef4444;
}

/* ====================
   4. Layout & Grid
   ==================== */
.container {
    width: 100%;
    max-width: 130rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1.5rem;
}

.col {
    padding: 0 1.5rem;
    flex: 1;
}

.col-1 { flex: 0 0 100%; max-width: 100%; }
.col-2 { flex: 0 0 50%; max-width: 50%; }
.col-3 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-4 { flex: 0 0 25%; max-width: 25%; }

.py-sm { padding-top: 2rem; padding-bottom: 2rem; }
.py-md { padding-top: 4rem; padding-bottom: 4rem; }
.py-lg { padding-top: 8rem; padding-bottom: 8rem; }

.mb-sm { margin-bottom: 2rem; }
.mb-md { margin-bottom: 4rem; }
.mb-lg { margin-bottom: 8rem; }

.section {
    padding: 6rem 0;
}

.section-alt {
    background-color: var(--light-gray);
}

/* ====================
   5. Navigation & Header
   ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--heading-color);
}

.logo img {
    height: 4rem;
    margin-right: 1rem;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    flex-wrap: nowrap;
}

.nav-item {
    margin-left: 1.8rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 0;
    position: relative;
    font-size: 1.5rem;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

/* Hamburger Menu (CSS Only) */
.hamburger {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
}

.hamburger span {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.nav-checkbox {
    display: none;
}

/* Main content padding to account for fixed header */
.main-content {
    padding-top: 8rem;
    min-height: calc(100vh - 20rem); /* Ensures footer stays at bottom */
}

/* Hero Section */
.hero {
    position: relative;
    background-color: var(--accent-light);
    padding: 8rem 0;
    text-align: center;
}

.hero-content {
    max-width: 60rem;
    margin: 0 auto;
    z-index: 10;
    position: relative;
}

.hero-title {
    font-size: 4.8rem;
    margin-bottom: 2rem;
}

.hero-description {
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.hero-image {
    margin: 4rem auto 0;
    max-width: 60rem;
}

/* ====================
   6. Footer
   ==================== */
.footer {
    background-color: var(--heading-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-column {
    flex: 1;
    min-width: 20rem;
    margin-bottom: 3rem;
}

.footer-title {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--medium-gray);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
    text-align: center;
    color: var(--medium-gray);
    font-size: 1.4rem;
}

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

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

.social-links a:hover {
    background-color: var(--accent-color);
}

/* ====================
   7. Components
   ==================== */
/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    margin: 1rem 0;
    font-size: 1.6rem;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--accent-dark);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-lg {
    padding: 1.2rem 3rem;
    font-size: 1.8rem;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 3rem;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 4rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 6rem;
    height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-light);
    color: var(--accent-color);
    border-radius: 50%;
    margin-bottom: 2rem;
    font-size: 2.4rem;
}

.card-title {
    font-size: 2rem;
    margin-bottom: 3rem;
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.6rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.6rem;
    padding-right: 4rem;
}

textarea.form-control {
    min-height: 15rem;
    resize: vertical;
}

/* Rates Table */
.rates-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.rates-table th,
.rates-table td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.rates-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.rates-table tr:last-child td {
    border-bottom: none;
}

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

/* Currency Flag and Code */
.currency {
    display: flex;
    align-items: center;
}

.currency-code {
    font-weight: 500;
    margin-right: 0.5rem;
}

.currency-name {
    color: var(--dark-gray);
    font-size: 1.4rem;
}

/* Testimonial Card */
.testimonial-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 3rem;
    margin-bottom: 3rem;
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    left: 2rem;
    font-size: 8rem;
    color: var(--accent-light);
    line-height: 1;
    font-family: Georgia, serif;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-name {
    font-weight: 600;
}

.testimonial-position {
    color: var(--dark-gray);
    font-size: 1.4rem;
}

/* FAQ Accordion (CSS only) */
.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 2rem;
    background-color: var(--light-gray);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: var(--medium-gray);
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.4rem;
    font-weight: 300;
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
}

.faq-item input[type="checkbox"] {
    display: none;
}

.faq-item input[type="checkbox"]:checked ~ .faq-answer {
    max-height: 50rem;
    padding: 2rem;
}

.faq-item input[type="checkbox"]:checked ~ .faq-question::after {
    content: '−';
}

/* ====================
   8. Page-Specific Styles
   ==================== */

/* Home Page */
.features-section {
    padding: 8rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.stats-section {
    background-color: var(--accent-color);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 3rem;
}

.stat-item {
    padding: 2rem;
}

.stat-number {
    font-size: 4.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 1.8rem;
}

/* About Page */
.about-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 3rem;
}

.team-member {
    text-align: center;
}

.team-photo {
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    margin: 0 auto 2rem;
    overflow: hidden;
    background-color: var(--light-gray);
}

.team-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.team-position {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

/* Services Page */
.service-item {
    margin-bottom: 5rem;
}

.service-icon {
    font-size: 5rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
}

/* Exchange Rates Page */
.rates-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.rates-filters .form-group {
    flex: 1;
    min-width: 20rem;
    margin-bottom: 0;
}

.rate-update-time {
    text-align: right;
    color: var(--dark-gray);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

/* Currency Converter Page */
.converter-card {
    max-width: 60rem;
    margin: 0 auto;
    padding: 4rem;
}

.currency-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.switch-icon {
    width: 4rem;
    height: 4rem;
    background-color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 2rem;
    color: var(--accent-color);
    font-size: 2rem;
}

.converter-result {
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 3rem;
}

.result-amount {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.result-explanation {
    color: var(--dark-gray);
    margin-top: 1rem;
}

/* Locations Page */
.locations-map {
    display: flex;
    justify-content: center;
    height: 100%;
    background-color: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 4rem;
    overflow: hidden;
}

.location-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.location-card {
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 2rem;
}

.location-name {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.location-address {
    margin-bottom: 1.5rem;
}

.location-hours {
    margin-bottom: 1.5rem;
}

.location-phone {
    font-weight: 500;
}

/* Testimonials Page */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

/* FAQ Page */
.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.faq-category {
    padding: 1rem 2rem;
    background-color: var(--light-gray);
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-category:hover, 
.faq-category.active {
    background-color: var(--accent-color);
    color: white;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 4rem;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 4rem;
    height: 4rem;
    background-color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1.5rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.contact-text {
    flex-grow: 1;
}

.contact-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ====================
   9. Media Queries
   ==================== */
@media (max-width: 992px) {
    html {
        font-size: 60%;
    }
    
    .col-md-1 { flex: 0 0 100%; max-width: 100%; }
    .col-md-2 { flex: 0 0 50%; max-width: 50%; }
    
    .section {
        padding: 5rem 0;
    }
    
    .hero {
        padding: 6rem 0;
    }
    
    .hero-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 58%;
    }
    
    .col-sm-1 { flex: 0 0 100%; max-width: 100%; }
    
    .section {
        padding: 4rem 0;
    }
    
    /* Hamburger Menu for Mobile */
    .hamburger {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 7.5rem; /* height of header */
        left: 0;
        width: 100%;
        height: 0;
        background-color: var(--bg-color);
        overflow: hidden;
        transition: height 0.3s ease;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav-list {
        flex-direction: column;
        padding: 2rem;
    }
    
    .nav-item {
        margin: 0 0 1.5rem 0;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 0;
        font-size: 1.8rem;
    }
    
    .nav-checkbox:checked ~ .nav-menu {
        height: calc(100vh - 7.5rem);
        overflow-y: auto;
    }
    
    .nav-checkbox:checked ~ .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-checkbox:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-checkbox:checked ~ .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        margin-bottom: 3rem;
    }
    
    .hero-title {
        font-size: 3.6rem;
    }
    
    .hero-description {
        font-size: 1.6rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rates-filters {
        flex-direction: column;
    }
    
    .rates-filters .form-group {
        width: 100%;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 55%;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .testimonials-grid,
    .team-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .converter-card {
        padding: 2rem;
    }
    
    .btn-lg {
        padding: 1rem 2.5rem;
        font-size: 1.6rem;
    }
}
