/* 
 * Project Scale Matrix Assessment Tool Styles
 * A clean, modern stylesheet for the matrix assessment application
 */

/* ================ Base Elements and Reset ================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
}

.subtitle {
    font-family: 'DM Serif Display', serif;
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

h1, h2, h3, h4 {
    font-family: 'DM Serif Display', serif;
    color: #000;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: #193a1b;
}

h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: #193a1b;
}

input, button, select {
    font-family: inherit;
    font-size: 1rem;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

button {
    cursor: pointer;
}

/* ================ Layout ================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 2rem;
}

/* ================ Card Styles ================ */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    border-top: 3px solid #4CAF50;
    margin-bottom: 2rem;
}

.input-group {
    border-radius: 6px;
    background-color: #f8f9fa;
    padding: 1rem;
    margin-bottom: 1rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: #193a1b;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ================ Form Styles ================ */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: 0.5rem;
}

/* ================ Table Styles ================ */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #ddd;
}

.table-light th {
    background-color: #f8f9fa;
}

/* Selectable cells */
.selectable-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    position: relative;
    padding: 0.5rem;
    min-height: 50px;
}

.selectable-cell:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.cell-high:hover {
    background-color: rgba(25, 58, 27, 0.08);
}

.cell-medium:hover {
    background-color: rgba(255, 152, 0, 0.08);
}

.cell-low:hover {
    background-color: rgba(76, 175, 80, 0.08);
}

.selectable-cell.selected {
    background-color: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4CAF50;
    font-weight: 500;
    padding-left: 7px; /* Compensate for the left border */
}

.cell-high.selected {
    background-color: rgba(25, 58, 27, 0.15);
    border-left: 3px solid #193a1b;
    padding-left: 7px;
}

.cell-medium.selected {
    background-color: rgba(255, 152, 0, 0.15);
    border-left: 3px solid #ff9800;
    padding-left: 7px;
}

.cell-low.selected {
    background-color: rgba(76, 175, 80, 0.15);
    border-left: 3px solid #4CAF50;
    padding-left: 7px;
}

.cell-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    height: 100%;
    padding-left: 10px;
}

.cell-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.cell-high .cell-indicator {
    background-color: #193a1b;
}

.cell-medium .cell-indicator {
    background-color: #ff9800;
}

.cell-low .cell-indicator {
    background-color: #4CAF50;
}

/* ================ Button Styles ================ */
.btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
    text-align: center;
    display: inline-block;
    margin-right: 0.5rem;
}

.btn:hover {
    background-color: #193a1b;
}

.btn-primary {
    background-color: #4CAF50;
}

.btn-secondary {
    background-color: #193a1b;
}

.btn-success {
    background-color: #4CAF50;
}

.btn-info {
    background-color: #0dcaf0;
    color: #000;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ================ Results Display ================ */
.score-display {
    background-color: #f0f7fb;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

#totalScore {
    font-family: 'DM Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #193a1b;
}

#scaleClassification {
    font-weight: 600;
}

.results-group {
    background-color: #f0f7fb;
    border-radius: 6px;
    padding: 1rem;
}

.result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
    gap: 0.5rem;
}

.result-label {
    font-weight: 500;
}

.result-value {
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
}

.currency {
    color: #193a1b;
}

.progress {
    height: 1rem;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ================ Score Classifications ================ */
.score-low {
    color: #4CAF50;
}

.score-medium {
    color: #ff9800;
}

.score-high {
    color: #193a1b;
}

.score-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.score-legend-item {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
}

/* Column styles for the matrix */
.table thead th {
    text-align: left;
    vertical-align: middle;
}

.table thead th:nth-child(2) {
    background-color: #193a1b;
    color: #fff;
    border-radius: 4px 4px 0 0;
}

.table thead th:nth-child(3) {
    background-color: #388e3c;
    color: #fff;
    border-radius: 4px 4px 0 0;
}

.table thead th:nth-child(4) {
    background-color: #e8f5e9;
    color: #193a1b;
    border-radius: 4px 4px 0 0;
}

.table thead th small {
    font-weight: normal;
    color: inherit;
    opacity: 0.8;
}

.highlight {
    background-color: rgba(76, 175, 80, 0.1);
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
    margin-top: 1rem;
}

/* ================ File Input ================ */
input[type="file"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    width: 100%;
}

small {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ================ Data Actions ================ */
.data-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .data-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .data-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* ================ Footer ================ */
footer {
    margin-top: 3rem;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ================ Animation ================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#resultsCard, #historyCard {
    animation: fadeIn 0.5s ease-in-out;
}

.selectable-cell.selected {
    animation: pulse 0.5s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for selectable cells */
@media (max-width: 768px) {
    .selectable-cell {
        min-height: 60px;
    }
    
    .score-legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cell-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}