/* Credit Card Payoff Calculator - Mobile First CSS */
/* Reset and Base Styles */
.cc-payoff-calculator-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.cc-payoff-calculator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    background: #ffffff;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Title Section */
.cc-title-section {
    background: #2CEC00;
    color: #ffffff;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

.cc-title-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cc-title-section p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Input Section */
.cc-input-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.cc-form-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cc-card-input-group {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.cc-card-input-group h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.cc-form-group {
    margin-bottom: 1.25rem;
}

.cc-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.cc-input,
.cc-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s ease;
    min-height: 44px; /* Touch-friendly */
}

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

.cc-input[type="number"] {
    -moz-appearance: textfield;
}

.cc-input[type="number"]::-webkit-outer-spin-button,
.cc-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cc-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Advanced Options */
.cc-advanced-toggle {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    transition: background-color 0.15s ease;
}

.cc-advanced-toggle:hover {
    background: #f9fafb;
}

.cc-toggle-icon {
    transition: transform 0.3s ease;
}

.cc-advanced-toggle.active .cc-toggle-icon {
    transform: rotate(180deg);
}

.cc-advanced-options {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.cc-advanced-section {
    margin-bottom: 1.25rem;
}

.cc-advanced-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

/* Buttons */
.cc-btn-primary,
.cc-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    min-height: 44px;
    width: 100%;
    margin-bottom: 0.75rem;
}

.cc-btn-primary {
    background: #22c55e;
    color: #ffffff;
}

.cc-btn-primary:hover {
    background: #16a34a;
}

.cc-btn-secondary {
    background: #2563eb;
    color: #ffffff;
}

.cc-btn-secondary:hover {
    background: #1d4ed8;
}

/* Loading State */
.cc-loading {
    text-align: center;
    padding: 2rem;
}

.cc-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #22c55e;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: cc-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes cc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.cc-results-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
}

.cc-results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cc-results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

/* Summary Cards */
.cc-summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cc-summary-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.cc-summary-card h4 {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.cc-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* Progress Bar */
.cc-progress-section {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.cc-progress-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.cc-progress-bar {
    height: 1rem;
    background: #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.cc-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 0.5rem;
    transition: width 1s ease;
}

.cc-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Charts */
.cc-charts-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cc-chart-container {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.cc-chart-container h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
    text-align: center;
}

.cc-chart-container canvas {
    width: 100% !important;
    height: 250px !important;
}

/* Timeline Table */
.cc-timeline-section {
    margin-bottom: 1.5rem;
}

.cc-timeline-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.cc-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.cc-timeline-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.cc-timeline-table th,
.cc-timeline-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.cc-timeline-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

.cc-timeline-table th:first-child,
.cc-timeline-table td:first-child {
    text-align: left;
}

.cc-timeline-table tr:hover {
    background: #f9fafb;
}

/* Breakdown Section */
.cc-breakdown-section {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.cc-breakdown-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.cc-breakdown-grid {
    display: grid;
    gap: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.breakdown-label {
    font-weight: 500;
    color: #374151;
}

.breakdown-value {
    font-weight: 600;
    color: #111827;
}

/* Action Buttons */
.cc-action-buttons {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Error States */
.cc-error {
    border-color: #ef4444 !important;
}

.cc-error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Print Styles */
@media print {
    .cc-input-section,
    .cc-action-buttons,
    .cc-advanced-toggle {
        display: none !important;
    }
    
    .cc-results-section {
        display: block !important;
        border: none;
        padding: 0;
    }
    
    .cc-chart-container {
        page-break-inside: avoid;
    }
    
    .cc-timeline-table {
        min-width: auto;
    }
}

/* Tablet Styles */
@media (min-width: 481px) {
    .cc-title-section {
        padding: 2rem 1.5rem;
    }
    
    .cc-title-section h1 {
        font-size: 2rem;
    }
    
    .cc-input-section {
        padding: 2rem;
    }
    
    .cc-results-section {
        padding: 2rem;
    }
    
    .cc-summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cc-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cc-action-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    .cc-payoff-calculator-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .cc-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cc-title-section h1 {
        font-size: 2.25rem;
    }
    
    .cc-btn-primary,
    .cc-btn-secondary {
        width: auto;
        margin-bottom: 0;
    }
    
    .cc-action-buttons {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }
}

/* Small Mobile Optimization */
@media (max-width: 360px) {
    .cc-input-section,
    .cc-results-section {
        padding: 1rem;
    }
    
    .cc-summary-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .cc-summary-value {
        font-size: 1rem;
    }
    
    .cc-chart-container canvas {
        height: 200px !important;
    }
    
    .cc-btn-primary,
    .cc-btn-secondary {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}