/* 
 * Foreign Exchange Rates Website Template
 * A responsive, SEO-optimized template for forex rates
 */

/* Base styles and CSS reset */
:root {
    /* Primary color palette */
    --primary-color: #002fa7; /* Changed from #2c3e50 to #0030bb */
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --text-color: #333333;
    --light-text: #f8f9fa;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --hover-color: #e9ecef;
    
    /* Status colors */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Typography */
    --body-font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --heading-font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Layout */
    --sidebar-width: 250px;
    --header-height: 60px;
    --container-max-width: 1200px;
    --content-padding: 20px;
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    font-size: 16px;
    scroll-behavior: smooth;
}
body {
    font-family: var(--body-font);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
p {
    margin-bottom: 1rem;
}
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: var(--accent-color);
}
img {
    max-width: 100%;
    height: auto;
}
ul {
    list-style: none;
}
button {
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1001;
}
.skip-link:focus {
    top: 0;
}
/* Layout */
.wrapper {
    display: flex;
    position: relative;
    min-height: 100vh;
    width: 100%;
}

#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar styles - new approach for fixed position at top of viewport */
#sidebar {
    /* Basic positioning and dimensions */
    width: var(--sidebar-width);
    position: fixed;
    /* Adjusted to slightly below the top to avoid browser edge rendering issues */
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    background: var(--primary-color);
    color: var(--light-text);
    transition: all var(--transition-speed) ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* Absolute positioned gradient that extends outside the sidebar */
#sidebar:before {
    content: '';
    position: absolute;
    /* Position slightly above the sidebar to ensure complete coverage */
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #ffc107, #90be6d, #28a745);
    z-index: 1000;
}

/* Sidebar header normal styling */
.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    /* Add padding to account for the gradient */
    padding-top: 20px;
}

.sidebar-header h2 {
    color: var(--light-text);
    font-weight: 700;
    margin-bottom: 0;
}

.nav-menu {
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: var(--light-text);
    opacity: 0.8;
    transition: all var(--transition-speed) ease;
}

.nav-menu a:hover, 
.nav-menu a.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-dropdown .fa-chevron-down {
    transition: transform var(--transition-speed) ease;
}

.nav-dropdown .rotate {
    transform: rotate(180deg);
}

.nav-menu .collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

/* FIXED: Increased max-height to accommodate all dropdown items */
.nav-menu .show {
    max-height: 2000px;
}

.nav-menu .collapse a {
    padding-left: 50px;
}

.sidebar-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    width: 100%;
    margin-top: 30px;
    /* Removed absolute positioning to prevent overlay issues */
}

.last-updated {
    opacity: 0.7;
}

/* Header styles */
header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.mobile-header {
    display: none;
    align-items: center;
}

.mobile-header h1 {
    font-size: 1.25rem;
    margin: 0;
    margin-left: 15px;
}

#sidebar-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: none;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
    cursor: pointer;
    z-index: 1010;
    transition: background-color 0.2s ease;
}

#sidebar-toggle:hover {
    background-color: var(--hover-color);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.utility-nav {
    display: flex;
    align-items: center;
}

.search-container {
    position: relative;
    margin-right: 15px;
}

.search-container input {
    padding: 8px 12px;
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 200px;
    transition: width var(--transition-speed) ease;
}

.search-container input:focus {
    width: 250px;
    outline: none;
    border-color: var(--secondary-color);
}

.search-container button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
}

.settings-dropdown {
    position: relative;
}

.settings-toggle {
    font-size: 1.2rem;
    color: var(--primary-color);
    padding: 5px;
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    display: none;
    z-index: 100;
}

.settings-dropdown:hover .settings-menu {
    display: block;
}

.settings-menu ul {
    padding: 5px 0;
}

.settings-menu a {
    display: block;
    padding: 8px 15px;
    color: var(--text-color);
}

.settings-menu a:hover {
    background-color: var(--hover-color);
}

/* Main content */
main {
    flex: 1;
    padding: var(--content-padding);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Enhanced Hero Section with colored gradient */
.hero-section {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Decorative top gradient matching news section */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #ffc107, #90be6d, #28a745);
}

.hero-section h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    /* Optional: Add the same title style as news section */
    padding-bottom: 10px;
    position: relative;
    display: inline-block;
}

/* Optional: Add underline accent to h1 like in news section */
.hero-section h1::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

.quick-conversion {
    margin-top: 25px;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 6px;
}

.converter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
}

.form-group {
    flex: 1;
    min-width: 120px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.swap-button {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
}

.swap-button button {
    background: var(--secondary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed) ease;
}

.swap-button button:hover {
    background: var(--accent-color);
}

.result-group {
    flex-basis: 100%;
    margin-top: 10px;
}

#conversion-result {
    font-size: 1.2rem;
    font-weight: 500;
}

.result-value {
    color: var(--secondary-color);
    font-weight: 700;
}

/* Table styles */
.major-rates-section,
.cross-rates-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

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

.rates-table th,
.rates-table td,
.cross-rates-table th,
.cross-rates-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

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

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

.rates-table tr:hover td,
.cross-rates-table tr:hover td {
    background-color: var(--hover-color);
}

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

.change-up {
    color: var(--success-color);
}

.change-down {
    color: var(--danger-color);
}

.view-all-link {
    margin-top: 15px;
    text-align: right;
}

.view-all-link a {
    font-weight: 500;
}

.view-all-link i {
    margin-left: 5px;
}

      /* Enhanced Links Box Container */
.links-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

/* Decorative top gradient similar to news section */
.links-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #ffc107, #90be6d, #28a745);
}

/* Section title with accent underline */
.links-box h2 {
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.links-box h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Link Items - similar to news cards */
.link-item {
    border: none;
    border-radius: 8px;
    padding: 0;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    position: relative;
}

/* Colored left border, cycling through the 5 strength meter colors */
.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.link-item:nth-child(5n+1)::before {
    background-color: #dc3545; /* Red */
}

.link-item:nth-child(5n+2)::before {
    background-color: #fd7e14; /* Orange */
}

.link-item:nth-child(5n+3)::before {
    background-color: #ffc107; /* Yellow */
}

.link-item:nth-child(5n+4)::before {
    background-color: #90be6d; /* Light green */
}

.link-item:nth-child(5n+5)::before {
    background-color: #28a745; /* Bright green */
}

/* Link styling */
.link-item a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    display: block;
    padding: 15px 20px 15px 24px; /* Extra left padding to account for the colored border */
    transition: color 0.2s ease, background-color 0.2s ease;
}

.link-item a:hover {
    color: var(--secondary-color);
    background-color: #f8f9fa;
}

/* Link item hover effect */
.link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Link Categories */
.link-category {
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Category title with accent */
.link-category-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f1f1;
    position: relative;
}

/* Small colored dot before category title */
.link-category-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* First category needs less top margin */
.link-category:first-of-type {
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .links-box {
        padding: 20px;
    }
    
    .links-grid {
        gap: 15px;
    }
    
    .link-category-title {
        font-size: 1.1rem;
    }
}

/* Chart styles */
.chart-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-container {
    height: 300px;
    margin: 20px 0;
}

/* Chart placeholder styles - replace with actual charts in production */
.chart-placeholder {
    height: 100%;
    position: relative;
    background-color: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
}

.chart-lines {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
}

.chart-line {
    height: 1px;
    background-color: var(--border-color);
}

.chart-curve {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, var(--secondary-color), var(--accent-color));
    clip-path: polygon(
        0% 70%, 
        10% 65%, 
        20% 90%, 
        30% 85%, 
        40% 70%, 
        50% 60%, 
        60% 40%, 
        70% 30%, 
        80% 40%, 
        90% 20%, 
        100% 25%, 
        100% 100%, 
        0% 100%
    );
    opacity: 0.7;
}

.chart-options {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.chart-period {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--light-bg);
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
}

.chart-period:hover {
    background-color: var(--hover-color);
}

.chart-period.active {
    background-color: var(--secondary-color);
    color: white;
}

/* News section */
.news-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.news-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

.news-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.news-meta {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 10px;
}

/* Container for both elements */
.intro-section {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
}

/* Intro text box */
.intro-text {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.intro-title {
    color: #002fa7;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.intro-content {
    font-size: 1rem;
    color: #555;
    margin: 0;
}

/* Hero banner container */
.hero-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
}

/* Hero banner styles */
.hero-banner {
    width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Gradient background */
.gradient-bg {
    background: linear-gradient(135deg, #2980b9, #3498db, #2980b9, #3498db);
    background-size: 300% 300%;
    animation: gradient-animation 8s ease infinite;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 180px;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Banner content */
.banner-title {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Call to action button */
.cta-button {
    display: inline-block;
    background-color: #2ecc71;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background-color: #27ae60;
    color: white;
}

.cta-button:active {
    transform: translateY(1px);
}

/* Decorative elements */
.currency-icon {
    position: absolute;
    font-size: 120px;
    opacity: 0.1;
    color: white;
}

.currency-icon.dollar {
    top: 10px;
    left: 10px;
}

.currency-icon.euro {
    bottom: 10px;
    right: 20px;
}

.currency-icon.pound {
    top: 30px;
    right: 40px;
    font-size: 100px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .intro-section {
        flex-direction: column;
    }

    .intro-text, .hero-container {
        min-width: 100%;
    }
    
    .banner-title {
        font-size: 1.8rem;
    }

    .gradient-bg {
        padding: 30px 20px;
        min-height: 150px;
    }

    .currency-icon {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .intro-title {
        font-size: 1.5rem;
    }
    
    .banner-title {
        font-size: 1.5rem;
    }

    .cta-button {
        font-size: 1rem;
        padding: 10px 25px;
    }

    .gradient-bg {
        padding: 25px 15px;
    }

    .currency-icon {
        font-size: 60px;
    }
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 20px;
    font-size: 0.9rem;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.disclaimer {
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #777;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.copyright {
    color: #777;
}

/* Responsive styles */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .search-container input {
        width: 160px;
    }
    
    .search-container input:focus {
        width: 200px;
    }
}

@media (max-width: 767px) {
    :root {
        --content-padding: 15px;
    }
    
    #sidebar {
        left: -300px; /* Ensure it's offscreen */
        position: fixed;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    #sidebar.active {
        left: 0;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    #content {
        width: 100%;
        margin-left: 0;
        transition: margin-left 0.3s ease;
    }
    
    #content.shifted {
        margin-left: var(--sidebar-width);
    }
    
    .mobile-header {
        display: flex;
        align-items: center;
    }
    
    #sidebar-toggle {
        display: block;
        margin-right: 10px;
        position: relative;
    }
    
    /* Force showing the sidebar-toggle button */
    body .mobile-header #sidebar-toggle {
        display: block !important;
    }
}
    
    .converter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .swap-button {
        align-self: center;
        padding: 0;
        margin: 10px 0;
    }
    
    .chart-section {
        padding: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    header {
        padding: 0 15px;
    }
    
    .search-container {
        display: none;
    }
    
    .hero-section,
    .major-rates-section,
    .cross-rates-section,
    .chart-section,
    .news-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .rates-table th,
    .rates-table td,
    .cross-rates-table th,
    .cross-rates-table td {
        padding: 10px;
    }
    
    .news-card {
        padding: 15px;
    }
    
    .chart-options {
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

/* Print styles */
@media print {
    #sidebar, 
    header, 
    .chart-options,
    .view-all-link,
    .news-section,
    footer {
        display: none;
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    body {
        background-color: white;
    }
    
    .hero-section, 
    .major-rates-section,
    .cross-rates-section,
    .chart-section {
        box-shadow: none;
        margin-bottom: 30px;
        page-break-inside: avoid;
    }
    
    h1 {
        font-size: 22pt;
    }
    
    h2 {
        font-size: 18pt;
    }
}

/* Optimizations for SEO and performance */
/* Reduce layout shifts */
.table-responsive,
.chart-container,
.news-card {
    contain: content;
}

/* Reduce content jumping during load */
.hero-section,
.major-rates-section,
.cross-rates-section,
.chart-section,
.news-section {
    min-height: 100px;
}

/* Better image rendering */
img {
    text-rendering: optimizeSpeed;
    text-size-adjust: 100%;
}

/* Improve accessibility for focusable elements */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Animation optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ADDED: Additional fixes for dropdown visibility */
.nav-menu .collapse.show {
    overflow-y: auto;
}

/* Currency Strength Meter Styles */
.strength-meter-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.strength-meter-container {
    margin-top: 20px;
}

.strength-meters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.meter-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.meter-currency {
    width: 45px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.meter-bar-container {
    flex: 1;
    height: 12px;
    background-color: #f1f1f1;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 10px;
}

.meter-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* Gradient color classes for the meter */
.meter-bar.very-weak {
    background-color: #dc3545; /* Bright red */
}

.meter-bar.weak {
    background-color: #fd7e14; /* Orange */
}

.meter-bar.neutral {
    background-color: #ffc107; /* Yellow */
}

.meter-bar.strong {
    background-color: #90be6d; /* Light green */
}

.meter-bar.very-strong {
    background-color: #28a745; /* Bright green */
}

.meter-value {
    width: 30px;
    text-align: right;
    font-weight: 500;
}

.strength-last-updated {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #777;
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .strength-meters {
        grid-template-columns: 1fr;
    }
    
    .meter-item {
        margin-bottom: 12px;
    }
}

@media (max-width: 575px) {
    .strength-meter-section {
        padding: 15px;
    }
}

/* For print */
@media print {
    .strength-meter-section {
        page-break-inside: avoid;
    }
}

/* Convert button */
.convert-button {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    margin-top: 15px;
}

.convert-button:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.convert-button:active {
    transform: translateY(1px);
}

/* Enhanced News Section */
.news-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Decorative background element */
.news-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #ffc107, #90be6d, #28a745);
}

/* Section title with accent */
.news-section h2 {
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.news-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* Enhanced grid layout */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* Enhanced news cards */
.news-card {
    border: none;
    border-radius: 8px;
    padding: 0;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* News category indicator - randomly assigns a category color to each card */
.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.news-card:nth-child(5n+1)::before {
    background-color: #dc3545; /* Red */
}

.news-card:nth-child(5n+2)::before {
    background-color: #fd7e14; /* Orange */
}

.news-card:nth-child(5n+3)::before {
    background-color: #ffc107; /* Yellow */
}

.news-card:nth-child(5n+4)::before {
    background-color: #90be6d; /* Light green */
}

.news-card:nth-child(5n+5)::before {
    background-color: #28a745; /* Bright green */
}

/* Card header */
.news-card-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid #f1f1f1;
}

.news-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-card h3 a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.news-card h3 a:hover {
    color: var(--secondary-color);
}

/* News meta data with icon */
.news-meta {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    align-items: center;
}

.news-meta i {
    margin-right: 5px;
    color: #aaa;
    font-size: 0.9rem;
}

/* Card content */
.news-card-content {
    padding: 15px 20px 20px;
    flex-grow: 1;
}

.news-card-content p {
    color: #666;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Read more link with icon */
.news-read-more {
    margin-top: 10px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 500;
}

.news-read-more a {
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
}

.news-read-more a i {
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.news-read-more a:hover i {
    transform: translateX(3px);
}

/* Card hover effect */
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* View all news link enhancement */
.view-all-link {
    margin-top: 25px;
    text-align: center;
}

.view-all-link a {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 30px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.view-all-link a i {
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.view-all-link a:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.view-all-link a:hover i {
    transform: translateX(3px);
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .view-all-link a {
        width: 100%;
        justify-content: center;
    }
}

/* Additional styles for Forex Pivot Tables */
.forex-pivot-section {
    margin-bottom: 30px;
}

.forex-pivot-section .table-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    padding-bottom: 8px;
    position: relative;
    display: inline-block;
}

.forex-pivot-section .table-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* If you need to accommodate specific pivot table styling */
.rates-table tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.rates-table tr:hover td {
    background-color: rgba(52, 152, 219, 0.05);
}

/* For currency pairs column if needed */
.rates-table td:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Optional: Numeric value styling */
.rates-table td:not(:first-child) {
    text-align: right;
    font-family: monospace;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .forex-pivot-section {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        margin-bottom: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .forex-pivot-section .table-title {
        font-size: 1.1rem;
    }
}

/* Make sidebar header links inherit the white color */
.sidebar-header h2 a {
    color: var(--light-text);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-header h2 a:hover {
    color: var(--light-text);
    opacity: 0.9;
}