/* 
 * Pricing Calculator Styles
 * A clean, modern stylesheet for the pricing calculator 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;
}

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;
}

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

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

header {
    margin-bottom: 2rem;
}

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

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* For mobile screens */
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    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;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

/* ================ Business Model Panel ================ */
.input-group {
    border-radius: 6px;
    background-color: #f8f9fa;
    padding: 1rem;
}

.input-with-prefix,
.input-with-suffix {
    display: flex;
    align-items: center;
}

.prefix, .suffix {
    padding: 0.5rem;
    background-color: #ecf0f1;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    min-width: 30px;
    text-align: center;
}

.suffix {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.input-with-prefix input {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.input-with-suffix input {
    border-radius: 4px 0 0 4px;
    min-width: 80px;
}

/* ================ Currency Settings ================ */
.currency-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.base-currency-display {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.currency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currency-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .currency-row {
        flex-wrap: wrap;
    }
    
    .currency-toggle {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .currency-rate-input {
        margin-left: 60px; /* Align with currency label */
    }
}

.currency-label {
    font-weight: 500;
    width: 60px;
}

.currency-toggle {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.currency-toggle input[type="checkbox"] {
    margin-right: 0.5rem;
}

.currency-rate-input {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.currency-rate-label {
    font-size: 0.9rem;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.currency-rate-input input {
    width: 100px;
}

/* ================ Results Display ================ */
.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;
}

@media (max-width: 576px) {
    .result {
        grid-template-columns: 1fr;
    }
    
    .result-right {
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    grid-column: 1 / -1;
}

.result-left {
    display: flex;
    flex-direction: column;
}

.result-right {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eee;
    padding-left: 0.5rem;
}

.result-label {
    font-weight: 500;
    grid-column: 1 / -1;
}

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

.currency {
    color: #193a1b;
}

.rounded-value {
    position: relative;
    text-decoration: underline dotted #3498db;
    cursor: help;
}

.base-currency-value {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.currency-conversions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.currency-item {
    display: flex;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

@media (max-width: 576px) {
    .currency-item {
        font-size: 0.85rem;
    }
}

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

/* ================ Project Panel ================ */
.task-input {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 576px) {
    .task-input {
        grid-template-columns: 1fr;
    }
}

.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;
}

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

/* Label styled as button (for file inputs) */
label.btn {
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

/* Task list table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

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

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

tfoot {
    font-weight: 600;
}

@media (max-width: 576px) {
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Make the task name column take most of the space */
    th:first-child, td:first-child {
        width: 40%;
    }
    
    /* Make the days and cost columns narrower */
    th:nth-child(2), td:nth-child(2),
    th:nth-child(3), td:nth-child(3) {
        width: 25%;
    }
    
    /* Make the actions column as small as possible */
    th:last-child, td:last-child {
        width: 10%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ================ Adjustments Section ================ */
.adjustment-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.adjustment-panel {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
}

.factor-input {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 0.5rem;
    align-items: end;
}

/* Allocation bar styling */
.allocation-status {
    margin: 1rem 0;
}

.allocation-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.allocation-progress {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.allocation-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    text-align: right;
    color: #7f8c8d;
}

/* Factor list items */
.factor-list {
    margin-top: 1rem;
}

.factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f0f7fb;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .factor-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .factor-details {
        width: 100%;
        margin-top: 0.75rem;
        justify-content: space-between;
    }
}

.factor-name {
    font-weight: 500;
    max-width: 60%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .factor-name {
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

.factor-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 150px;
}

.allocation-edit {
    display: flex;
    align-items: center;
    min-width: 70px;
}

.allocation-input {
    width: 50px;
    text-align: right;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: 'DM Mono', monospace;
}

.allocation-percent {
    margin-left: 2px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.factor-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.factor-toggle:checked {
    background-color: #4CAF50;
}

.factor-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.factor-toggle:checked::before {
    transform: translateX(16px);
}

.factor-remove {
    border: none;
    background: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
}

.factor-remove:hover {
    color: #c0392b;
}

/* ================ Rate Comparison ================ */
.comparison {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fff;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .comparison-row {
        flex-direction: column;
    }
    
    .comparison-value {
        margin-top: 0.25rem;
    }
}

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

.comparison-value {
    font-family: 'DM Mono', monospace;
    margin-right: 0.5rem;
}

.comparison-diff {
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

.diff-positive {
    background-color: rgba(76, 175, 80, 0.1);
    color: #193a1b;
}

.diff-negative {
    background-color: #fdedec;
    color: #c0392b;
}

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

@media (max-width: 768px) {
    .data-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .data-actions .btn,
    .data-actions label.btn {
        width: 100%;
        max-width: 250px;
        display: inline-block;
        box-sizing: border-box;
        text-align: center;
        cursor: pointer;
    }
}

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

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

.btn-accent {
    background-color: #000;
    color: white;
}

.btn-primary:hover {
    background-color: #3d8b40;
}

.btn-secondary:hover {
    background-color: #0d210f;
}

.btn-accent:hover {
    background-color: #333;
}

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