/* Frontend Styles for Bank Interest Rates Plugin */

.bir-rates-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.bir-rates-header {
    text-align: center;
    margin-bottom: 30px;
}

.bir-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.bir-updated-time {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Section */
.bir-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.bir-section-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    border-bottom: 3px solid #2271b1;
    padding-bottom: 10px;
}

/* Table Controls */
.bir-table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.bir-search-box {
    flex: 1;
    min-width: 200px;
}

.bir-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.bir-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.bir-sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bir-sort-options label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.bir-sort-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.3s;
}

.bir-sort-select:focus {
    outline: none;
    border-color: #2271b1;
}

/* Table Wrapper */
.bir-table-wrapper {
    margin-bottom: 20px;
}

.bir-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Rates Table */
.bir-rates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}

.bir-rates-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bir-rates-table thead th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

.bir-rates-table thead th small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 2px;
}

.bir-sort-icon {
    display: inline-block;
    margin-left: 5px;
    opacity: 0.6;
    cursor: pointer;
}

.bir-col-bank {
    text-align: left !important;
    min-width: 180px;
}

.bir-col-rate {
    min-width: 100px;
    cursor: pointer;
    transition: background 0.2s;
}

.bir-col-rate:hover {
    background: rgba(255,255,255,0.1);
}

/* Table Body */
.bir-rates-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

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

.bir-rates-table tbody tr.bir-featured {
    background-color: #fffbf0;
}

.bir-rates-table tbody tr.bir-featured:hover {
    background-color: #fff4d9;
}

.bir-rates-table tbody td {
    padding: 15px 10px;
}

/* Bank Cell */
.bir-bank-cell {
    font-weight: 500;
}

.bir-bank-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bir-bank-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.bir-bank-logo svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.bir-bank-details {
    flex: 1;
}

.bir-bank-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.bir-bank-name:hover {
    color: #2271b1;
}

.bir-featured-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
}

/* Rate Cell */
.bir-rate-cell {
    text-align: center;
}

.bir-rate-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bir-rate-value strong {
    font-size: 16px;
    font-weight: 700;
    color: #2c5aa0;
}

.bir-online-rate {
    display: block;
    font-size: 11px;
    color: #00a32a;
    font-weight: 500;
}

.bir-rate-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

.bir-rate-change.bir-up {
    color: #00a32a;
    background: #e7f5ec;
}

.bir-rate-change.bir-down {
    color: #d63638;
    background: #f8e5e6;
}

.bir-no-data {
    color: #999;
    font-style: italic;
}

/* Calculator */
.bir-calculator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
}

.bir-calculator h3 {
    margin: 0 0 25px 0;
    font-size: 22px;
    text-align: center;
}

.bir-calculator-form {
    max-width: 500px;
    margin: 0 auto;
}

.bir-calc-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.bir-calc-row label {
    flex: 0 0 120px;
    font-weight: 500;
}

.bir-calc-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 16px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    transition: all 0.3s;
}

.bir-calc-input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255,255,255,0.2);
}

.bir-calc-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.bir-calc-unit {
    flex: 0 0 60px;
    font-weight: 500;
}

.bir-calc-button {
    width: 100%;
    padding: 15px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bir-calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.bir-calc-button:active {
    transform: translateY(0);
}

.bir-calculator-result {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.bir-calculator-result h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
}

.bir-result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.bir-result-item:last-child {
    border-bottom: none;
}

.bir-result-item.bir-highlight {
    font-size: 18px;
    font-weight: 700;
    padding-top: 15px;
}

.bir-result-label {
    font-weight: 500;
}

.bir-result-value {
    font-weight: 700;
    font-size: 20px;
}

/* Disclaimer */
.bir-disclaimer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #ffa500;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.bir-disclaimer strong {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .bir-rates-wrapper {
        margin: 20px 10px;
    }
    
    .bir-section {
        padding: 15px;
        border-radius: 8px;
    }
    
    .bir-title {
        font-size: 22px;
    }
    
    .bir-section-title {
        font-size: 18px;
    }
    
    .bir-table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bir-search-box,
    .bir-sort-options {
        width: 100%;
    }
    
    .bir-sort-options {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .bir-sort-select {
        width: 100%;
    }
    
    .bir-rates-table {
        font-size: 12px;
    }
    
    .bir-rates-table thead th {
        padding: 10px 5px;
        font-size: 11px;
    }
    
    .bir-rates-table tbody td {
        padding: 10px 5px;
    }
    
    .bir-bank-logo {
        width: 32px;
        height: 32px;
    }
    
    .bir-bank-name {
        font-size: 13px;
    }
    
    .bir-rate-value strong {
        font-size: 14px;
    }
    
    .bir-calculator {
        padding: 20px;
    }
    
    .bir-calc-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bir-calc-row label {
        margin-bottom: 5px;
    }
    
    .bir-calc-unit {
        text-align: right;
    }
}

/* Print styles */
@media print {
    .bir-table-controls,
    .bir-calculator,
    .bir-sort-icon {
        display: none !important;
    }
    
    .bir-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .bir-rates-table {
        font-size: 10px;
    }
}

/* Loading animation */
.bir-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.bir-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: bir-rotate 0.8s linear infinite;
}

@keyframes bir-rotate {
    to { transform: rotate(360deg); }
}

/* Smooth transitions */
.bir-rates-table tbody tr,
.bir-rate-value,
.bir-bank-name,
.bir-calc-button {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.bir-search-input:focus,
.bir-sort-select:focus,
.bir-calc-input:focus {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bir-rates-table thead {
        background: #000;
    }
    
    .bir-calculator {
        background: #000;
        border: 2px solid #fff;
    }
}
