/* Car Insurance Premium Calculator - Main Stylesheet */
.cipc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    box-sizing: border-box;
}

/* Title Container */
.cipc-title-container {
    background-color: #2CEC00;
    color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.cipc-title-container h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.cipc-title-container p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

/* Wrapper */
.cipc-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Cards */
.cipc-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.cipc-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Form Grid */
.cipc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cipc-form-group {
    display: flex;
    flex-direction: column;
}

.cipc-form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    display: block;
}

.cipc-form-group input,
.cipc-form-group select {
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

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

.cipc-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
    display: block;
}

/* Buttons */
.cipc-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.cipc-btn-primary {
    background-color: #22c55e;
    color: white;
}

.cipc-btn-primary:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
}

.cipc-btn-secondary {
    background-color: #2563eb;
    color: white;
}

.cipc-btn-secondary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.cipc-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Advanced Options */
.cipc-advanced-toggle {
    text-align: center;
    margin: 1.5rem 0;
}

.cipc-advanced-options {
    animation: fadeIn 0.3s ease-in-out;
}

.cipc-advanced-options h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Results Section */
.cipc-results-section {
    animation: slideIn 0.5s ease-out;
}

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

/* Summary Cards */
.cipc-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.cipc-summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.cipc-summary-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cipc-amount {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0.5rem 0;
    word-break: break-word;
}

.cipc-note {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Charts Container */
.cipc-charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cipc-chart-wrapper {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    height: 300px;
    box-sizing: border-box;
    position: relative;
}

.cipc-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Breakdown Table */
.cipc-breakdown {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.cipc-breakdown h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 600;
}

.cipc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    min-width: 600px;
}

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

.cipc-breakdown-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.cipc-breakdown-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.cipc-breakdown-table tr:last-child td {
    border-bottom: none;
}

.cipc-total-row {
    background-color: #f0f9ff;
}

.cipc-total-row td {
    font-weight: 600;
}

/* Notification */
.cipc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    max-width: 350px;
}

.cipc-notification-success {
    background-color: #10b981;
}

.cipc-notification-error {
    background-color: #ef4444;
}

.cipc-notification-info {
    background-color: #3b82f6;
}

/* Loading State */
.cipc-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.cipc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .cipc-container {
        padding: 15px;
    }
    
    .cipc-title-container {
        padding: 1.5rem;
    }
    
    .cipc-title-container h1 {
        font-size: 1.5rem;
    }
    
    .cipc-card {
        padding: 1rem;
    }
    
    .cipc-form-grid {
        grid-template-columns: 1fr;
    }
    
    .cipc-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cipc-charts-container {
        grid-template-columns: 1fr;
    }
    
    .cipc-action-buttons {
        flex-direction: column;
    }
    
    .cipc-btn {
        width: 100%;
    }
    
    .cipc-breakdown-table {
        min-width: 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cipc-container {
        padding: 10px;
    }
    
    .cipc-title-container {
        padding: 1rem;
    }
    
    .cipc-title-container h1 {
        font-size: 1.25rem;
    }
    
    .cipc-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .cipc-amount {
        font-size: 1.5rem;
    }
    
    .cipc-breakdown-table {
        font-size: 0.875rem;
    }
    
    .cipc-breakdown-table th,
    .cipc-breakdown-table td {
        padding: 0.5rem;
    }
    
    .cipc-chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 360px) {
    .cipc-container {
        padding: 5px;
    }
    
    .cipc-card {
        padding: 0.75rem;
    }
    
    .cipc-form-group label {
        font-size: 0.875rem;
    }
    
    .cipc-form-group input,
    .cipc-form-group select {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .cipc-action-buttons {
        gap: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .cipc-advanced-toggle,
    .cipc-action-buttons,
    .cipc-charts-container {
        display: none !important;
    }
    
    .cipc-container {
        padding: 0;
        max-width: none;
    }
    
    .cipc-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .cipc-title-container {
        background-color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .cipc-breakdown-table {
        min-width: 0;
        width: 100%;
    }
}

/* Accessibility */
.cipc-btn:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.cipc-form-group input:focus,
.cipc-form-group select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.1);
}

/* Ensure no horizontal overflow */
.cipc-container,
.cipc-wrapper,
.cipc-card,
.cipc-form-group input,
.cipc-form-group select {
    max-width: 100%;
    overflow-x: hidden;
}