/**
 * Online Tools - Professional CSS
 * Premium design that beats React apps
 */

/* Tool Container */
.oit-tool-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Tool Header */
.oit-tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.oit-tool-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 15px;
    line-height: 1.2;
}

.oit-tool-description {
    font-size: 1.125rem;
    color: #4a5568;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tool Introduction */
.oit-tool-intro {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(25, 118, 210, 0.3);
}

.oit-tool-intro h2 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 20px;
}

.oit-tool-intro p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* Tool Content Sections - Add boxes */
.oit-tool-container h3 {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 15px 20px;
    border-radius: 12px;
    border-left: 4px solid #1976d2;
    margin: 30px 0 20px 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #2d3748;
}

/* Section Grid Layout - Sections arranged in 3 columns */
.oit-sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.oit-section-item {
    display: flex;
    flex-direction: column;
}

.oit-section-item h3 {
    margin-top: 0 !important;
}

.oit-tool-container ul,
.oit-tool-container ol {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin: 20px 0;
    line-height: 1.8;
    list-style: none;
    flex: 1;
}

.oit-tool-container ul li,
.oit-tool-container ol li {
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
    border-radius: 8px;
    border-left: 3px solid #1976d2;
    color: #4a5568;
    position: relative;
    transition: all 0.3s ease;
}

.oit-tool-container ul li:hover,
.oit-tool-container ol li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
}

.oit-tool-container ul li strong,
.oit-tool-container ol li strong {
    color: #1976d2;
    display: block;
    margin-bottom: 5px;
    font-size: 1.05rem;
}

/* Ordered lists should show numbers */
.oit-tool-container ol {
    counter-reset: ol-counter;
}

.oit-tool-container ol li {
    counter-increment: ol-counter;
}

.oit-tool-container ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.oit-tool-container p {
    margin: 15px 0;
    line-height: 1.8;
    color: #4a5568;
}

/* Calculator Card */
.oit-calculator {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.oit-calculator h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Form Groups */
.oit-form-group {
    margin-bottom: 18px;
}

.oit-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

.oit-form-group input,
.oit-form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.oit-form-group input:focus,
.oit-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.oit-form-group small {
    display: block;
    margin-top: 6px;
    color: #718096;
    font-size: 0.875rem;
}

/* Input with Icon */
.oit-input-wrapper {
    position: relative;
}

.oit-input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-weight: 600;
}

.oit-input-with-icon {
    padding-left: 45px !important;
}

/* Buttons */
.oit-btn {
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.oit-btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
}

.oit-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.5);
}

.oit-btn-reset {
    background: #e2e8f0;
    color: #4a5568;
    margin-left: 10px;
}

.oit-btn-reset:hover {
    background: #cbd5e0;
}

.oit-btn-block {
    width: 100%;
    margin-top: 10px;
}

/* Results */
.oit-results {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 35px;
    border-radius: 16px;
    margin-top: 30px;
    display: none;
    animation: slideIn 0.4s ease;
}

.oit-results.active {
    display: block;
}

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

.oit-result-title {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 20px;
    font-weight: 600;
}

.oit-result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
}

.oit-result-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.oit-result-breakdown {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

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

.oit-breakdown-item:last-child {
    border-bottom: none;
}

.oit-breakdown-label {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.oit-breakdown-value {
    color: white;
    font-weight: 700;
}

/* Info Alert */
.oit-alert {
    padding: 18px 24px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
}

.oit-alert-info {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    color: #2c5282;
}

.oit-alert-success {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
    color: #22543d;
}

.oit-alert-warning {
    background: #fffaf0;
    border-left: 4px solid #ed8936;
    color: #7c2d12;
}

/* Grid Layout */
.oit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

/* Chart Placeholder */
.oit-chart {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

/* Table */
.oit-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.oit-table thead {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
}

.oit-table th {
    padding: 16px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.oit-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

.oit-table tbody tr:hover {
    background: #f7fafc;
}

/* Responsive */
@media (max-width: 1200px) {
    /* 3-column sections become 2-column on smaller desktops */
    .oit-sections-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .oit-tool-title {
        font-size: 2rem;
    }

    .oit-calculator {
        padding: 25px 20px;
    }

    /* All sections become single column on mobile */
    .oit-sections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .oit-tool-container h3 {
        font-size: 1.1rem;
        padding: 12px 15px;
    }

    .oit-tool-container ul li,
    .oit-tool-container ol li {
        padding: 12px;
    }
}

    .oit-tool-intro {
        padding: 25px;
    }

    .oit-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .oit-btn-reset {
        margin-left: 0;
    }

    .oit-result-value {
        font-size: 2rem;
    }
}

/* Loading State */
.oit-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Success Animation */
.oit-success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(72, 187, 120, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Utility Classes */
.oit-text-center { text-align: center; }
.oit-mb-20 { margin-bottom: 20px; }
.oit-mt-20 { margin-top: 20px; }
.oit-hidden { display: none !important; }

/* ============================================================================
   PREMIUM EMI CALCULATOR STYLES
   ============================================================================ */

/* Premium Calculator Container */
.oit-calculator.premium-emi {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.oit-calculator.premium-emi h3 {
    font-size: 2rem;
    color: #2d3748;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

/* Premium Grid Layout - Side by Side */
.oit-premium-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.oit-input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.oit-chart-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 12px;
    flex-direction: column;
}

.oit-chart-section canvas {
    max-width: 100%;
    max-height: 350px;
    width: auto !important;
    height: auto !important;
}

/* Premium Range Sliders */
.oit-premium-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #1976d2 0%, #4caf50 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.oit-premium-slider:hover {
    opacity: 1;
}

.oit-premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
    border: 3px solid #1976d2;
    transition: all 0.2s ease;
}

.oit-premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.7);
}

.oit-premium-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
    border: 3px solid #1976d2;
    transition: all 0.2s ease;
}

.oit-premium-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.7);
}

/* Slider Labels */
.oit-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

/* Premium Form Group Override */
.premium-emi .oit-form-group {
    margin-bottom: 0;
}

.premium-emi .oit-form-group label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
}

/* Summary Cards */
.oit-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.oit-summary-card {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.25);
    transition: transform 0.3s ease;
}

.oit-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(25, 118, 210, 0.35);
}

.oit-card-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oit-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

/* Amortization Section */
.oit-amortization-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.oit-amortization-section h4 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 25px;
    font-weight: 700;
}

/* Table Controls */
.oit-table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.oit-btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.oit-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(25, 118, 210, 0.4);
}

/* Table Wrapper - Scrollable */
.oit-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Custom Scrollbar */
.oit-table-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.oit-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.oit-table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    border-radius: 10px;
}

.oit-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4caf50 0%, #1976d2 100%);
}

/* Enhanced Table for Amortization */
.oit-amortization-section .oit-table {
    margin-top: 0;
    border-radius: 0;
}

.oit-amortization-section .oit-table th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
    z-index: 10;
}

.oit-amortization-section .oit-table td {
    font-size: 0.95rem;
    font-weight: 500;
}

.oit-amortization-section .oit-table tbody tr:nth-child(even) {
    background: #f7fafc;
}

.oit-amortization-section .oit-table tbody tr:hover {
    background: #edf2f7;
}

/* Responsive Design for Premium Calculator */
@media (max-width: 1024px) {
    .oit-premium-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .oit-summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .oit-calculator.premium-emi,
    .oit-calculator.premium-sip {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .oit-calculator.premium-emi h3,
    .oit-calculator.premium-sip h3 {
        font-size: 1.5rem;
    }

    .oit-amortization-section {
        padding: 25px 15px;
    }

    .oit-amortization-section h4 {
        font-size: 1.25rem;
    }

    .oit-card-value {
        font-size: 1.4rem;
    }

    .oit-table-wrapper {
        max-height: 400px;
    }
}

/* ============================================================================
   PREMIUM SIP CALCULATOR STYLES (inherits most from EMI, with custom colors)
   ============================================================================ */

.oit-calculator.premium-sip {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.oit-calculator.premium-sip h3 {
    font-size: 2rem;
    color: #2d3748;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

/* SIP uses the same blue-green theme as the site */
.premium-sip .oit-summary-card {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
}

.premium-sip .oit-premium-slider {
    background: linear-gradient(to right, #1976d2 0%, #4caf50 100%);
}

.premium-sip .oit-premium-slider::-webkit-slider-thumb {
    border: 3px solid #1976d2;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
}

.premium-sip .oit-premium-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.7);
}

.premium-sip .oit-premium-slider::-moz-range-thumb {
    border: 3px solid #1976d2;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
}

.premium-sip .oit-premium-slider::-moz-range-thumb:hover {
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.7);
}

/* SIP table header matches theme */
.premium-sip .oit-table thead {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
}

/* SIP scrollbar matches theme */
.premium-sip .oit-table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1976d2 0%, #4caf50 100%);
}

.premium-sip .oit-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4caf50 0%, #1976d2 100%);
}

/* ============================================================================
   PREMIUM BMI CALCULATOR STYLES
   ============================================================================ */

.oit-calculator.premium-bmi {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.oit-calculator.premium-bmi h3 {
    font-size: 2rem;
    color: #2d3748;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

/* BMI Result Card */
.bmi-result-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
    border-left: 5px solid #48bb78;
    transition: all 0.3s ease;
}

.bmi-score {
    font-size: 4rem;
    font-weight: 900;
    color: #48bb78;
    line-height: 1;
    margin-bottom: 10px;
}

.bmi-category-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #48bb78;
    margin-bottom: 15px;
}

.bmi-advice {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}
