/* Bank Charges Calculator - Main Stylesheet */

/* Reset and Base Styles */
.bcc-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.bcc-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    background-color: #ffffff;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

/* Title Container */
.bcc-title-container {
    background: #2CEC00;
    color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bcc-title-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.bcc-title-container p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Cards */
.bcc-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form Grid */
.bcc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.bcc-input-group {
    display: flex;
    flex-direction: column;
}

.bcc-input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.95rem;
}

.bcc-input-group input,
.bcc-input-group select {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
}

.bcc-input-group input:focus,
.bcc-input-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.bcc-btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.bcc-btn-primary {
    background: #22c55e;
    color: white;
}

.bcc-btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.bcc-btn-secondary {
    background: #2563eb;
    color: white;
}

.bcc-btn-secondary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* Advanced Options */
.bcc-advanced-options {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed #e5e7eb;
    animation: fadeIn 0.3s ease;
}

.bcc-advanced-options h3 {
    margin-bottom: 1.5rem;
    color: #374151;
}

/* Action Buttons */
.bcc-action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Results Section */
.bcc-results-section {
    animation: slideUp 0.5s ease;
}

/* Summary Cards */
.bcc-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.bcc-summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.bcc-summary-card:hover {
    transform: translateY(-2px);
}

.bcc-summary-card h3 {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.bcc-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

/* Breakdown Table */
.bcc-breakdown-section {
    margin: 2rem 0;
}

.bcc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bcc-breakdown-table th,
.bcc-breakdown-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.bcc-breakdown-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

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

.bcc-breakdown-table tr:hover {
    background: #f9fafb;
}

/* Charts Section */
.bcc-charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.bcc-chart-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.bcc-chart-container h3 {
    margin-bottom: 1rem;
    color: #374151;
}

.bcc-chart-container canvas {
    max-height: 300px;
}

/* Export Buttons */
.bcc-export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Loading Overlay */
.bcc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.bcc-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Error Messages */
.bcc-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.bcc-input-group.error input {
    border-color: #dc2626;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
/* Tablet (481px–768px) */
@media (max-width: 768px) {
    .bcc-container {
        padding: 15px;
    }
    
    .bcc-title-container {
        padding: 1.5rem;
    }
    
    .bcc-title-container h1 {
        font-size: 2rem;
    }
    
    .bcc-card {
        padding: 1.5rem;
    }
    
    .bcc-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .bcc-charts-section {
        grid-template-columns: 1fr;
    }
    
    .bcc-action-buttons,
    .bcc-export-buttons {
        flex-direction: column;
    }
    
    .bcc-btn {
        width: 100%;
    }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .bcc-container {
        padding: 10px;
    }
    
    .bcc-title-container {
        padding: 1rem;
    }
    
    .bcc-title-container h1 {
        font-size: 1.75rem;
    }
    
    .bcc-title-container p {
        font-size: 1rem;
    }
    
    .bcc-card {
        padding: 1rem;
    }
    
    .bcc-form-grid {
        grid-template-columns: 1fr;
    }
    
    .bcc-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .bcc-breakdown-table {
        font-size: 0.875rem;
    }
    
    .bcc-breakdown-table th,
    .bcc-breakdown-table td {
        padding: 0.75rem;
    }
}

/* Small Mobile (≤360px) */
@media (max-width: 360px) {
    .bcc-title-container h1 {
        font-size: 1.5rem;
    }
    
    .bcc-amount {
        font-size: 1.5rem;
    }
    
    .bcc-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .bcc-action-buttons,
    .bcc-export-buttons,
    #bcc-advanced-toggle,
    .bcc-btn {
        display: none !important;
    }
    
    .bcc-container {
        padding: 0;
    }
    
    .bcc-card {
        border: 1px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }
    
    .bcc-title-container {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Accessibility */
.bcc-btn:focus,
.bcc-input-group input:focus,
.bcc-input-group select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.bcc-btn:focus-visible,
.bcc-input-group input:focus-visible,
.bcc-input-group select:focus-visible {
    outline: 3px solid #2563eb;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bcc-card,
    .bcc-summary-card,
    .bcc-chart-container {
        border: 2px solid #000;
    }
    
    .bcc-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bcc-btn,
    .bcc-summary-card,
    .bcc-advanced-options,
    .bcc-results-section {
        transition: none;
        animation: none;
    }
}