/* TIBOR Rates Website Styles */

:root {
    --primary-color: #538aff;
    --primary-dark: #051c5b;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #06ad9c;
    --text-secondary: #06ad9c;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improved focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove focus outline for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.header-content {
    flex: 1;
}

.header-logos {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 56px;
    max-height: 200px;
}

.header-logo {
    height: 200px;
    width: auto;
    max-width: auto;
    object-fit: contain;
}

.header-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Dark Mode Toggle */
.theme-toggle {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.theme-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(20deg);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

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

.btn-icon {
    font-size: 1.2rem;
    display: inline-block;
    transition: transform 0.3s;
}

.btn-primary:hover .btn-icon {
    transform: rotate(180deg);
}

/* Info Banner */
.info-banner {
    background-color: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.info-banner p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.info-banner p:last-child {
    margin-bottom: 0;
}

.info-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-banner a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.info-banner a:hover {
    text-decoration: underline;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--surface);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-value.status {
    font-size: 1.2rem;
}

.stat-value-dual {
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value-dual .time-jst {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-value-dual .time-local {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Sections */
section {
    background-color: var(--surface);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.rate-date {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Current Rates Grid */
.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.rate-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #bae6fd;
    transition: all 0.3s;
}

.rate-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.rate-tenor {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.rate-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* Historical Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.controls {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tenor Checkboxes */
.tenor-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--background);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    user-select: none;
}

.checkbox-label:hover {
    background-color: var(--surface);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.form-select {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.3s ease, color 0.3s ease;
}

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

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rates-table thead {
    background-color: #f1f5f9;
}

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

.rates-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.rates-table tbody tr {
    transition: background-color 0.2s;
}

.rates-table tbody tr:hover {
    background-color: #f8fafc;
}

.rates-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.loading-cell {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Reference Banks Section */
.reference-banks-section {
    background-color: var(--surface);
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.banks-header {
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface);
    transition: background-color 0.2s ease;
    user-select: none;
}

.banks-header:hover {
    background-color: var(--background);
}

.banks-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.banks-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 30px;
}

.banks-content.expanded {
    max-height: 2000px;
    padding: 0 30px 30px 30px;
}

.banks-intro {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.banks-category {
    margin-bottom: 25px;
}

.banks-category h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

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

.bank-item {
    padding: 12px 16px;
    background-color: var(--background);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.bank-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.banks-note {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Historical Table Section (Recent Rates Collapsible) */
.historical-table-section {
    background-color: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section-header-collapsible {
    padding: 25px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface);
    transition: background-color 0.2s ease;
    user-select: none;
}

.section-header-collapsible:hover {
    background-color: var(--background);
}

.section-header-collapsible h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 30px;
}

.collapsible-content.expanded {
    max-height: 3000px;
    padding: 0 30px 30px 30px;
}

/* IFR Calculator Section */
.ifr-calculator-section {
    background-color: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ifr-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 25px;
}

.ifr-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.btn-primary {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-primary:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.error-message {
    padding: 15px;
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger-color);
    border-radius: 4px;
    color: var(--danger-color);
    margin-bottom: 20px;
}

.ifr-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.summary-card {
    background-color: var(--background);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.summary-value {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.ifr-table-container {
    margin-top: 30px;
}

.ifr-table-container h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* IFR Mode Toggle */
.mode-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--background);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.mode-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 280px;
    height: 44px;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.slider-text-left,
.slider-text-right {
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 2;
    transition: color 0.3s ease;
}

.slider-text-left {
    color: white;
}

.slider-text-right {
    color: var(--text-secondary);
}

.slider-button {
    position: absolute;
    left: 4px;
    width: 130px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 18px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider .slider-button {
    transform: translateX(140px);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider .slider-text-left {
    color: var(--text-secondary);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider .slider-text-right {
    color: white;
}

.mode-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

/* IFR Tabs */
.ifr-tabs-container {
    margin: 25px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ifr-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.ifr-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ifr-tab:hover {
    color: var(--primary);
    background: var(--background);
}

.ifr-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* Forward Rate Matrix & Heatmap */
.matrix-header {
    margin-bottom: 25px;
}

.matrix-header h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.matrix-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.heatmap-container {
    margin: 30px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.legend-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(to right, 
        #4CAF50,
        #8BC34A,
        #CDDC39,
        #FFEB3B,
        #FFC107,
        #FF9800,
        #FF5722
    );
    border-radius: 4px;
    border: 1px solid var(--border);
}

.legend-values {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.heatmap-grid {
    display: grid;
    grid-template-columns: auto repeat(5, 1fr);
    gap: 2px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.heatmap-cell {
    background: var(--surface);
    padding: 15px 10px;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.heatmap-cell.header {
    background: var(--background);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.heatmap-cell.empty {
    background: var(--background);
    opacity: 0.3;
}

.heatmap-cell:not(.header):not(.empty):hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.cell-rate {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cell-period {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.matrix-table-container {
    margin-top: 30px;
}

.matrix-table-container h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* Future Mode Results */
.current-rates-display {
    margin-bottom: 25px;
}

.current-rates-display h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.rate-card {
    background-color: var(--background);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.rate-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.rate-value {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.forward-rate-result {
    margin-bottom: 25px;
}

.forward-rate-result h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.forward-rate-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 35px;
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.forward-rate-main {
    text-align: center;
    margin-bottom: 25px;
}

.forward-rate-value {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: block;
}

.forward-rate-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 25px;
}

.forward-rate-details p {
    margin: 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forward-rate-details strong {
    font-weight: 600;
}

.interpretation-box {
    background-color: var(--background);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow);
}

.interpretation-box h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1rem;
}

.interpretation-box p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* IFR Table difference coloring */
.diff-close {
    color: var(--secondary-color);
    font-weight: 600;
}

.diff-moderate {
    color: var(--warning-color);
    font-weight: 600;
}

.diff-large {
    color: var(--danger-color);
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--surface);
    padding: 40px 30px 20px 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-banks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-banks span {
    padding: 6px 12px;
    background-color: var(--background);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.footer-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto;
}

.footer-note {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Loading State */
.rate-card.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .tenor-checkboxes {
        flex-direction: column;
    }
    
    .checkbox-label {
        width: 100%;
    }

    .form-select {
        width: 100%;
    }

    .chart-container {
        height: 300px;
    }

    .rates-table {
        font-size: 0.85rem;
    }

    .rates-table th,
    .rates-table td {
        padding: 10px;
    }

    /* Reference Banks Mobile */
    .banks-header {
        padding: 15px 20px;
    }

    .banks-header h3 {
        font-size: 1rem;
    }

    .banks-content.expanded {
        padding: 0 20px 20px 20px;
    }

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

    /* Recent Rates Mobile */
    .section-header-collapsible {
        padding: 20px;
    }

    .section-header-collapsible h2 {
        font-size: 1.25rem;
    }

    .collapsible-content.expanded {
        padding: 0 20px 20px 20px;
    }

    /* IFR Calculator Mobile */
    .ifr-controls {
        flex-direction: column;
        gap: 15px;
    }

    .ifr-control-group {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .ifr-summary {
        grid-template-columns: 1fr;
    }
    
    /* Mode Toggle Mobile */
    .toggle-switch {
        width: 100%;
    }
    
    .slider-button {
        width: calc(50% - 8px);
    }
    
    .toggle-switch input[type="checkbox"]:checked + .toggle-slider .slider-button {
        transform: translateX(calc(100% - 4px));
    }
    
    /* Future Mode Mobile */
    .rates-grid {
        grid-template-columns: 1fr;
    }
    
    .forward-rate-value {
        font-size: 2.5rem;
    }
    
    .forward-rate-details {
        font-size: 0.9rem;
    }
    
    .forward-rate-details p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    footer {
        padding: 30px 20px 15px 20px;
    }
}

/* ==============================================================================
   ADDITIONAL UI POLISH
   ============================================================================== */

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

.skeleton {
    background: linear-gradient(90deg, var(--background) 0%, var(--surface) 50%, var(--background) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Improved Button States */
button, .btn-primary {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.2s ease;
}

button:hover, .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

button:active, .btn-primary:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Ripple Effect on Click */
button::after, .btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after, .btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Smooth Transitions for Theme Toggle */
.theme-toggle {
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.05);
}

/* Improved Table Hover States */
.rates-table tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Enhanced Card Shadows on Hover */
.summary-card:hover,
.rate-card:hover,
.future-rate-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-lg);
}

/* Improved Select Dropdown */
select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%233b82f6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px;
}

/* Tooltip Support */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: var(--text-primary);
    color: var(--surface);
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* Scroll to Top Button (if added in future) */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.scroll-to-top.visible {
    opacity: 1;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
}

/* ==============================================================================
   PRINT STYLES
   ============================================================================== */

@media print {
    /* Hide interactive elements */
    .theme-toggle,
    button,
    .toggle-icon,
    .section-header-collapsible,
    .banks-header,
    header .header-actions {
        display: none !important;
    }
    
    /* Expand all collapsible sections */
    .collapsible-content,
    .banks-content {
        display: block !important;
        max-height: none !important;
    }
    
    /* Remove shadows and transitions */
    * {
        box-shadow: none !important;
        transition: none !important;
        animation: none !important;
    }
    
    /* Optimize colors for print */
    body {
        background-color: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
    }
    
    /* Page breaks */
    section {
        page-break-inside: avoid;
    }
    
    /* Ensure charts are visible */
    canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    /* Footer at bottom */
    footer {
        page-break-before: always;
    }
    
    /* URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Remove URL printing for internal links */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
}

/* ==============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================== */

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

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000EE;
        --text-primary: #000000;
        --background: #FFFFFF;
        --border-color: #000000;
    }
    
    button, .btn-primary {
        border: 2px solid currentColor;
    }
}
