/* Main Container */
.cic-calculator-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cic-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eaeaea;
}

.cic-header h2 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 3.0rem;
    font-weight: 700;
}

.cic-header p {
    color: #111827;
    margin: 0;
    font-size: 1.8rem;
}

/* Content Layout */
.cic-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .cic-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Input Section */
.cic-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.cic-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cic-input-group label {
    color: #34495e;
    font-weight: 600;
    font-size: 1.95rem;
    margin-bottom: 0.25rem;
}

.cic-input, .cic-select {
    padding: 1.575rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.cic-input:focus, .cic-select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.cic-input.cic-readonly {
    background-color: #f8f9fa;
    cursor: not-allowed;
    color: #6c757d;
}

.cic-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 3rem;
}

.cic-input-hint {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

/* Results Display */
.cic-results {
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #3894DA 0%, #3894DA 100%);
    border-radius: 12px;
    color: white;
}

.cic-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.cic-result-label {
    font-weight: 500;
    opacity: 0.9;
}

.cic-result-value {
    font-weight: 700;
    font-size: 1.25rem;
}

.cic-total-investment .cic-result-value {
    color: #ffd700;
}

/* Graph Section */
.cic-graph-section {
    display: flex;
    flex-direction: column;
}

.cic-graph-container {
    position: relative;
    height: 350px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    padding: 1rem;
    margin-bottom: 1rem;
}

.cic-graph-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.cic-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #2c3e50;
    font-weight: 500;
}

.cic-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: #4A90E2;
}

.cic-graph-stats {
    display: flex;
    gap: 1.5rem;
    color: #7f8c8d;
    font-size: 1.5rem;
}

.cic-graph-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cic-graph-stats span {
    font-weight: 600;
    color: #4A90E2;
    margin-top: 0.25rem;
}

/* Disclaimer */
.cic-disclaimer {
    margin-top: 2rem;
    padding: 1.25rem;
    background: #fff8e1;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    font-size: 0.9rem;
    color: #856404;
}

.cic-disclaimer p {
    margin: 0;
}

/* Loading Overlay */
.cic-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cic-loading.active {
    opacity: 1;
    visibility: visible;
}

.cic-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4A90E2;
    border-radius: 50%;
    animation: cic-spin 1s linear infinite;
}

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

/* Error Messages */
.cic-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: cic-slide-in 0.3s ease;
}

@keyframes cic-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cic-calculator-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .cic-header h2 {
        font-size: 1.8rem;
    }
    
    .cic-graph-container {
        height: 300px;
    }
    
    .cic-graph-legend {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .cic-graph-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* Print Styles */
@media print {
    .cic-calculator-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .cic-loading,
    .cic-error {
        display: none !important;
    }
}

.cic-compounding-frequency {visibility:hidden;}