/* Yield-on-Cost Projection Table - Responsive Design */
/* Base styles for mobile */
.yield-on-cost-calculator {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile optimizations (up to 640px) */
@media (max-width: 640px) {
    .yield-on-cost-calculator {
        padding: 0;
        margin: 0;
    }
    
    .calculator-sidebar {
        margin-bottom: 1rem;
        order: 2;
    }
    
    .calculator-results {
        order: 1;
        margin-bottom: 1rem;
    }
    
    .sticky-sidebar {
        position: relative !important;
        top: 0 !important;
    }
    
    /* Form optimizations */
    .yoc-calc-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 16px !important;
    }
    
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Chart responsiveness */
    .chart-container {
        height: 250px !important;
        min-height: 250px !important;
    }
    
    /* Table responsiveness */
    .results-table {
        font-size: 0.75rem;
        overflow-x: auto;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Summary cards */
    .summary-cards {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Header adjustments */
    .calculator-header h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    .calculator-header p {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
}

/* Tablet optimizations (641px to 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .chart-container {
        height: 300px !important;
        min-height: 300px !important;
    }
    
    /* Summary cards layout */
    .summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Form adjustments */
    .yoc-calc-input {
        font-size: 14px;
        padding: 0.875rem;
    }
}

/* Desktop optimizations (1025px and above) */
@media (min-width: 1025px) {
    .chart-container {
        height: 400px !important;
        min-height: 400px !important;
    }
    
    .summary-cards {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .yoc-calc-input {
        font-size: 14px;
        padding: 0.75rem;
    }
    
    .sticky-sidebar {
        position: sticky !important;
        top: 1rem !important;
    }
}

/* Custom scrollbar for results */
.calculator-results::-webkit-scrollbar {
    width: 8px;
}

.calculator-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.calculator-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.calculator-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Global styles */
* {
    box-sizing: border-box;
}

.yoc-calc-input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-results.active {
    animation: fadeInUp 0.5s ease-out;
}

/* Header gradient text */
.yoc-calc .bg-gradient-to-br h1 {
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Select styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select option {
    background-color: white;
    color: #374151;
    padding: 0.5rem;
}

select::-ms-expand {
    display: none;
}

select#payout_frequency,
select#custom_growth_rates,
.yoc-calc select {
    background-color: #f9fafb !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
}

select#payout_frequency:focus,
select#custom_growth_rates:focus,
.yoc-calc select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background-color: #ffffff !important;
}

select#payout_frequency option,
select#custom_growth_rates option {
    background-color: white;
    color: #374151;
    padding: 0.5rem;
}

/* Number input styling */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* Checkbox styling */
.yoc-calc-checkbox {
    appearance: none;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    display: inline-block;
    height: 1rem;
    width: 1rem;
    position: relative;
    transition: all 0.2s ease-in-out;
}

.yoc-calc-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.yoc-calc-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Button styling */
.yoc-calc-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.yoc-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Card styling */
.yoc-calc-card {
    transition: all 0.3s ease;
}

.yoc-calc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Orange color overrides for Tailwind */
.bg-orange-500 {
    background-color: #f97316 !important;
}

.text-orange-600 {
    color: #ea580c !important;
}

.border-orange-200 {
    border-color: #fed7aa !important;
}

.from-orange-50 {
    background-color: #fff7ed !important;
}

.to-orange-100 {
    background-color: #ffedd5 !important;
}

.bg-gradient-to-br.from-orange-50.to-orange-100 {
    background: linear-gradient(to bottom right, #fff7ed, #ffedd5) !important;
}

/* Text styling */
.yoc-calc .bg-white h2,
.yoc-calc .bg-white h3,
.yoc-calc .bg-white h4 {
    color: #111827;
    font-weight: 600;
}

/* Input styling with 2FA */
input[type="text"], 
input[type="number"], 
input[type="email"], 
input[type="password"], 
input[type="search"], 
input[type="tel"], 
input[type="url"],
.yoc-calc-input {
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
    width: 100% !important;
    background-color: #f9fafb !important;
    color: #374151 !important;
}

/* Force 2FA styling on all inputs */
.yoc-calc input[type="text"], 
.yoc-calc input[type="number"], 
.yoc-calc input[type="email"], 
.yoc-calc input[type="password"], 
.yoc-calc input[type="search"], 
.yoc-calc input[type="tel"], 
.yoc-calc input[type="url"],
.yoc-calc .yoc-calc-input {
    background-color: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
}

/* 2FA Input Focus States */
.yoc-calc-input:focus,
input[type="text"]:focus, 
input[type="number"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus, 
input[type="search"]:focus, 
input[type="tel"]:focus, 
input[type="url"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

/* Custom growth rates section */
#custom-growth-rates-section {
    display: none;
}

#custom-growth-rates-section.show {
    display: block;
}

/* Export buttons */
.export-btn {
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Chart container */
#yield-on-cost-chart {
    max-height: 400px;
}

/* Table styling */
.yoc-calc-table {
    border-collapse: collapse;
    width: 100%;
}

.yoc-calc-table th,
.yoc-calc-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

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

.yoc-calc-table tr:hover {
    background-color: #f9fafb;
}

/* Mobile responsive table */
@media (max-width: 640px) {
    .yoc-calc-table {
        font-size: 0.75rem;
    }
    
    .yoc-calc-table th,
    .yoc-calc-table td {
        padding: 0.5rem 0.25rem;
    }
    
    #custom-growth-rates-section {
        margin-top: 1rem;
    }
    
    .yoc-calc-table {
        overflow-x: auto;
        display: block;
    }
}

/* Custom growth rates input styling */
#custom-growth-rates-container input {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    background-color: #f9fafb;
}

#custom-growth-rates-container input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

/* Error states */
.yoc-calc-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.yoc-calc-input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading states */
.yoc-calc-loading {
    position: relative;
    pointer-events: none;
}

.yoc-calc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print styles */
@media print {
    .yield-on-cost-calculator {
        background: white !important;
        color: black !important;
    }
    
    .yoc-calc-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .yoc-calc-btn,
    .export-btn {
        display: none !important;
    }
} 