/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

#tunisolar-calculateur-app {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: inherit;
    color: #374151;
}

#tunisolar-calculateur-app h2, #tunisolar-calculateur-app h3, #tunisolar-calculateur-app h4 {
    color: #1e3a8a; /* Bleu TuniSolar */
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.profile-selection {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-btn {
    background-color: #f9fafb; /* Gris Clair */
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.profile-btn:hover {
    background-color: #1e3a8a;
    color: #ffffff;
}

.profile-btn.active {
    background-color: #1e3a8a; /* Bleu TuniSolar */
    color: #fff;
    border-color: #1e3a8a;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db; /* Gris clair */
    border-radius: 0.375rem; /* rounded-md */
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #1e3a8a; /* Bleu TuniSolar */
}

.action-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #16a34a; /* Vert Action */
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.action-btn:hover {
    background-color: #15803d; /* Vert plus sombre */
}

#results-display {
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 0.5rem; /* rounded-lg */
    border: 1px solid #dbeafe; /* border-blue-200 */
}

.results-report h3 {
    font-size: 1.8rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eef2ff;
    border-radius: 50%;
    color: #1e3a8a;
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-content {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
}

.card-value.text-green {
    color: #16a34a;
}
.card-value.text-orange {
    color: #f97316;
}

.bar-chart {
    margin-top: 2rem;
}

.bar-group {
    margin-bottom: 1rem;
    overflow: hidden; /* Prevent bar from overflowing its container */
}

.bar-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.bar {
    height: 30px;
    line-height: 30px;
    color: white;
    padding-left: 10px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    transition: width 1s ease-in-out;
    max-width: 100%; /* Ensure bar does not exceed container width */
}

.chart-legend {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    margin-top: 1rem;
}

.long-term-projection {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #eef2ff;
    border-radius: 8px;
    text-align: center;
}

.long-term-projection h4 {
    margin-top: 0;
}

.report-subtitle {
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 2rem;
    color: #6b7280;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    font-size: 1rem;
}

.financial-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.financial-table tr:last-child td {
    border-bottom: none;
}

.financial-table .total-row td {
    font-weight: bold;
    border-top: 2px solid #374151;
    border-bottom: 2px solid #374151;
}

.long-term-projection ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 450px;
    margin: 1rem auto 0;
}

.long-term-projection li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.5rem;
}

.long-term-projection li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: bold;
}

#tunisolar-calculateur-app.loading {
    filter: blur(4px);
    position: relative;
}

#loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #1e3a8a;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.report-subtitle {
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 2rem;
    color: #6b7280;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    font-size: 1rem;
}

.financial-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.financial-table tr:last-child td {
    border-bottom: none;
}

.financial-table .total-row td {
    font-weight: bold;
    border-top: 2px solid #374151;
    border-bottom: 2px solid #374151;
}

.long-term-projection ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 450px;
    margin: 1rem auto 0;
}

.long-term-projection li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.5rem;
}

.long-term-projection li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: bold;
}
