/* InveShares Calculator Hub - Frontend Styles */

/* Reset and Base Styles */
.inveshares-calculator-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.inveshares-calculator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Calculator Container */
.calc-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.calc-header {
    margin-bottom: 30px;
    text-align: center;
}

.calc-header h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
}

.calc-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Tabs */
.calc-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
    flex-wrap: wrap;
}

.calc-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-weight: 500;
}

.calc-tab:hover {
    color: #2563eb;
}

.calc-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* Tab Content */
.calc-tab-content {
    display: none;
}

.calc-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Form Elements */
.calc-form {
    margin-top: 20px;
}

.calc-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.calc-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

.calc-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.calc-input, .calc-select {
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s;
    width: 100%;
    font-family: inherit;
}

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

.calc-unit {
    position: absolute;
    right: 16px;
    bottom: 12px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

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

.calc-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.calc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

.calc-btn-primary:active {
    transform: translateY(0);
}

/* Results */
.calc-result {
    margin-top: 30px;
    animation: slideUp 0.4s;
}

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

.result-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #2563eb;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

.result-main {
    font-size: 48px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 15px;
}

.result-main.positive {
    color: #16a34a;
}

.result-main.negative {
    color: #dc2626;
}

.result-explanation {
    font-size: 16px;
    color: #1e293b;
    line-height: 1.6;
}

.result-breakdown {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(37, 99, 235, 0.2);
}

.result-breakdown p {
    margin-bottom: 10px;
    font-size: 15px;
    color: #475569;
}

/* Result Summary Table */
.result-summary {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.summary-item .label {
    font-weight: 600;
    color: #374151;
}

.summary-item .value {
    font-weight: 700;
    color: #1e40af;
}

.summary-item.highlight {
    background: #fef3c7;
    padding: 12px;
    margin: 8px -12px;
    border-radius: 6px;
}

.summary-item.success .value {
    color: #16a34a;
}

/* Breakdown Table */
.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.breakdown-table thead {
    background: #f3f4f6;
}

.breakdown-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.breakdown-table td {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    color: #1e293b;
}

/* Error Messages */
.calc-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calc-container {
        padding: 20px;
    }
    
    .calc-header h2 {
        font-size: 24px;
    }
    
    .calc-row {
        grid-template-columns: 1fr;
    }
    
    .calc-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .calc-tab {
        border-bottom: 2px solid #e5e7eb;
        border-left: 3px solid transparent;
    }
    
    .calc-tab.active {
        border-bottom-color: #e5e7eb;
        border-left-color: #2563eb;
    }
    
    .result-main {
        font-size: 36px;
    }
}

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

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

/* Print Styles */
@media print {
    .calc-container {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .calc-btn {
        display: none;
    }
}


/* ===== SOFT LIGHT GRAY TAB STYLE ===== */

.inveshares-calculator-wrapper .calc-tabs {
    border-bottom: none;
    gap: 6px;
}

/* default tab */
.inveshares-calculator-wrapper .calc-tab {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    background: transparent;
    color: #6b7280;
    transition: all 0.2s ease;
}

/* hover */
.inveshares-calculator-wrapper .calc-tab:hover {
    background: #f3f4f6;   /* light gray */
    color: #111827;
}

/* active */
.inveshares-calculator-wrapper .calc-tab.active,
.inveshares-calculator-wrapper .calc-tab[aria-selected="true"] {
    background: #e5e7eb;   /* darker gray */
    color: #111827;
    font-weight: 600;
}