/* WCT Stock Tool - Risk Calculator Styles */

.wct-risk-calculator {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wct-risk-calculator h3 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Financial Entry Form Styles */
.wct-financial-entry-form {
    margin-bottom: 20px;
}

.wct-financial-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 12px;
    table-layout: auto;
}

.wct-financial-table th,
.wct-financial-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.wct-financial-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wct-financial-table .metric-label {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding-left: 12px;
    min-width: 200px;
    white-space: nowrap;
}

.wct-financial-table input {
    width: 100%;
    border: none;
    padding: 4px;
    text-align: center;
    font-size: 11px;
    min-width: 80px;
}

.wct-financial-table input:focus {
    outline: 1px solid #3498db;
    background-color: #f0f8ff;
}

.wct-financial-table input.wct-error-field {
    background-color: #fdf2f2;
    outline: 1px solid #e74c3c;
}

.year-column {
    min-width: 100px;
    background-color: #e3f2fd !important;
}

.year-column input {
    font-weight: bold;
    font-size: 12px;
}

.remove-year-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.remove-year-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

#add-year-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
}

#add-year-btn:hover {
    background: #229954;
}

/* Financial Results */
.wct-financial-growth-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.wct-financial-growth-table th,
.wct-financial-growth-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.wct-financial-growth-table th {
    background-color: #f8f9fa;
}

.wct-calculate-btn {
    /* width: 100%; */
    padding: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wct-calculate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.wct-calculate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wct-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0px;
    margin-top: 0px;
}

.wct-results h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 10px;
}

.wct-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wct-risk-calculator {
        margin: 10px;
        padding: 15px;
    }

    .wct-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .wct-value {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .wct-risk-calculator {
        margin: 5px;
        padding: 10px;
    }

    .wct-form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .wct-calculate-btn {
        padding: 14px;
        font-size: 18px;
    }
}

/* Animation for results appearing */
.wct-results {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Trend Analysis Styles */
.wct-trend-analysis {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.trend-header {
    text-align: center;
    margin-bottom: 20px;
}

.trend-header h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
}

.base-year-info {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
}

/* Chart Container Styles */
.chart-container {
    width: 100%;
    height: 400px;
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.summary-stats {
    margin-top: 30px;
}

/* Grid.js Integration Styles */
.trend-grid-wrapper {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.trend-grid-wrapper .gridjs-wrapper {
    border: none;
    border-radius: 6px;
}

.trend-grid-wrapper .gridjs-container {
    border-radius: 6px;
}

/* Responsive adjustments for trend analysis */
@media (max-width: 768px) {
    .wct-trend-analysis {
        padding: 15px;
    }
    
    .base-year-info {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    /* Chart responsive adjustments */
    .chart-container {
        height: 300px;
        padding: 10px;
        margin: 15px 0;
    }
    
    /* Grid.js responsive adjustments */
    .trend-grid-wrapper .gridjs-th,
    .trend-grid-wrapper .gridjs-td {
        padding: 8px 6px !important;
        font-size: 11px !important;
    }
    
    .trend-grid-wrapper .gridjs-th {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .trend-table {
        font-size: 11px;
    }
    
    .trend-table th,
    .trend-table td {
        padding: 8px 6px;
    }
    
    /* Chart mobile adjustments */
    .chart-container {
        height: 250px;
        padding: 8px;
        margin: 10px 0;
    }
    
    /* Grid.js mobile adjustments */
    .trend-grid-wrapper .gridjs-th,
    .trend-grid-wrapper .gridjs-td {
        padding: 6px 4px !important;
        font-size: 10px !important;
    }
    
    .growth-value, .metric-value {
        font-size: 10px !important;
    }
}
