
/* Credit Card Payoff Calculator Styles */
.cc-calc-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.calc-header {
    text-align: center;
    margin-bottom: 30px;
}

.calc-header h2 {
    color: var(--primary-color, #007cba);
    margin-bottom: 10px;
    font-size: 28px;
}

.calc-header p {
    color: #666;
    font-size: 16px;
}

.calc-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.form-row label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    background: #fff;
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color, #007cba);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.currency-symbol {
    padding: 12px 15px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
}

.input-group input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 15px;
    font-size: 16px;
    background: transparent;
    color: #333 !important;
}

.input-suffix {
    padding: 12px 15px;
    color: #666;
    font-weight: 500;
}

select {
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    background: #fff !important;
    cursor: pointer;
    transition: border-color 0.3s ease;
    color: #333 !important;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    width: 100%;
    height: auto;
    min-height: 48px;
    position: relative;
    z-index: 999;
}

select:focus {
    border-color: var(--primary-color, #007cba) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    z-index: 1000;
}

select option {
    color: #333 !important;
    background: #fff !important;
    padding: 12px 15px;
    font-size: 16px;
    line-height: 1.5;
    min-height: 40px;
    display: block;
}

/* Fix for currency dropdown specifically */
.form-row:has(select[name="currency"]) {
    z-index: 100;
    position: relative;
}

select[name="currency"] {
    position: relative;
    z-index: 101;
}

/* Ensure dropdown appears above other elements */
select:focus,
select:active {
    position: relative;
    z-index: 1001;
}

.calc-mode-toggle {
    margin: 25px 0;
    position: relative;
    z-index: 5;
}

.toggle-buttons {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.toggle-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #f8f9fa !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    color: #333 !important;
}

.toggle-btn:hover {
    background: #e9ecef !important;
    color: #000 !important;
}

.toggle-btn.active {
    background: var(--primary-color, #007cba) !important;
    color: white !important;
}

.mode-content {
    position: relative;
    z-index: 5;
}

.advanced-options {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    position: relative;
    z-index: 5;
}

.advanced-toggle {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa !important;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    color: #333 !important;
}

.advanced-toggle:hover {
    background: #e9ecef !important;
    color: #000 !important;
}

.advanced-toggle span {
    color: #007cba !important;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.advanced-content {
    padding: 20px;
    display: grid;
    gap: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    position: relative;
    z-index: 5;
}

.calc-button {
    background: var(--primary-color, #007cba);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    position: relative;
    z-index: 5;
}

.calc-button:hover {
    background: #005a8b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.calc-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.calc-results {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    position: relative;
    z-index: 1;
}

.results-header h3 {
    color: var(--primary-color, #007cba);
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

.result-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color, #007cba);
    margin-bottom: 8px;
}

.result-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-toggle {
    text-align: center;
    margin: 25px 0;
}

.toggle-table-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #333;
}

.toggle-table-btn:hover {
    background: #e9ecef;
    border-color: #007cba;
    color: #000;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.amortization-table th,
.amortization-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.amortization-table th {
    background: var(--primary-color, #007cba);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.amortization-table td {
    font-size: 14px;
    color: #333;
}

.amortization-table tr:hover {
    background: #f8f9fa;
}

.ad-container {
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.affiliate-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    text-align: center;
}

.affiliate-widget h3 {
    margin-bottom: 15px;
    font-size: 22px;
}

.affiliate-btn {
    display: inline-block;
    background: #fff;
    color: #667eea;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.affiliate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #667eea;
}

/* Force visibility with !important */
.cc-calc-container * {
    box-sizing: border-box;
}

.cc-calc-container input,
.cc-calc-container select,
.cc-calc-container button,
.cc-calc-container label {
    color: #333 !important;
}

.cc-calc-container input::placeholder {
    color: #999 !important;
}

/* Additional dropdown fixes for browser compatibility */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px;
        padding-right: 40px;
    }
}

/* Firefox specific dropdown fixes */
@-moz-document url-prefix() {
    select {
        text-indent: 0.01px;
        text-overflow: "";
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cc-calc-container {
        margin: 10px;
        padding: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .toggle-buttons {
        flex-direction: column;
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .calc-header h2 {
        font-size: 24px;
    }
    
    select {
        font-size: 14px;
        padding: 10px 35px 10px 12px;
    }
    
    select option {
        font-size: 14px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .cc-calc-container {
        padding: 15px;
    }
    
    .form-row {
        margin-bottom: 15px;
    }
    
    .input-group input,
    .currency-symbol,
    .input-suffix {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .calc-button {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}
