/**
 * Property Evaluation Calculator Styles
 * Moncton Invest - Commercial Real Estate Platform
 */

/* Container and Layout */
.property-evaluation-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Progress Stepper Navigation */
.progress-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    gap: 1rem;
}

.stepper-step {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 8px;
    position: relative;
}

.stepper-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    height: 3px;
    background: #e5e7eb;
    z-index: -1;
}

.stepper-step.completed::after {
    background: var(--nb-gold);
}

.stepper-step:hover {
    background: rgba(196, 164, 132, 0.05);
}

.stepper-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.stepper-step.active .stepper-number {
    background: var(--nb-deep);
    color: white;
    border-color: var(--nb-gold);
    transform: scale(1.1);
}

.stepper-step.completed .stepper-number {
    background: var(--nb-gold);
    color: var(--ink);
}

.stepper-step.completed .stepper-number::before {
    content: '✓';
}

.stepper-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    transition: color 0.3s ease;
}

.stepper-step.active .stepper-label {
    color: var(--nb-deep);
}

.stepper-step.completed .stepper-label {
    color: var(--nb-gold);
}

/* Section Collapsible */
.section-collapsible {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.section-collapsible:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-left-color: var(--nb-gold);
}

.section-header {
    padding: 1.5rem;
    background: white;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.section-header:hover {
    background: rgba(196, 164, 132, 0.05);
    border-bottom-color: var(--nb-gold);
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--nb-deep);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.section-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: var(--nb-gold);
    font-weight: bold;
    background: rgba(196, 164, 132, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 50%;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 2rem;
    display: block;
    background: white;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-collapsed .section-content {
    display: none;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.tooltip-icon {
    cursor: help;
    color: var(--nb-gold);
    font-size: 1rem;
    background: rgba(196, 164, 132, 0.1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-group input,
.form-group select {
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--nb-gold);
    box-shadow: 0 0 0 3px rgba(196, 164, 132, 0.1);
}

.form-group.error input,
.form-group.error select {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    font-weight: 500;
}

.form-group.error .error-message {
    display: block;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Buttons */
.btn-proceed,
.btn-add-row,
.btn-generate-pdf {
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-height: 48px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-proceed {
    background: var(--nb-deep);
    color: white;
    margin-top: 1rem;
}

.btn-proceed:hover:not(:disabled) {
    background: #0a1929;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 33, 56, 0.3);
}

.btn-proceed:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-add-row,
.add-year-btn {
    background: var(--nb-gold);
    color: var(--ink);
    margin-top: 1rem;
}

.btn-add-row:hover,
.add-year-btn:hover {
    background: var(--nb-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 164, 132, 0.3);
}

.btn-add-row:disabled,
.add-year-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-remove-row {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-remove-row:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-generate-pdf {
    background: var(--nb-gold);
    color: var(--ink);
    font-size: 1.1rem;
    width: 100%;
    margin-top: 2rem;
    padding: 1.25rem 2rem;
}

.btn-generate-pdf:hover {
    background: var(--nb-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(196, 164, 132, 0.4);
}

/* Tables */
.historical-table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.historical-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.historical-table th {
    background: var(--nb-deep);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.historical-table th:first-child {
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--nb-deep);
}

.historical-table td {
    padding: 0.875rem;
    border: 1px solid #e5e7eb;
    background: white;
}

.historical-table td:first-child {
    font-weight: 600;
    color: var(--nb-deep);
    background: #f9fafb;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #e5e7eb;
}

.historical-table tbody tr:hover {
    background: rgba(196, 164, 132, 0.05);
}

.historical-table tbody tr:hover td:first-child {
    background: rgba(196, 164, 132, 0.1);
}

.historical-table input[type="text"],
.historical-table input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.historical-table input[type="text"]:focus,
.historical-table input[type="number"]:focus {
    outline: none;
    border-color: var(--nb-gold);
    box-shadow: 0 0 0 2px rgba(196, 164, 132, 0.2);
}

.year-header {
    position: relative;
}

.year-header .remove-year-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.year-header .remove-year-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.section-group {
    font-weight: 600;
    background: var(--nb-deep) !important;
    color: white !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.section-group td {
    background: var(--nb-deep) !important;
    color: white !important;
}

.readonly-field {
    background: #f3f4f6 !important;
    cursor: not-allowed;
}

.future-capex-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.future-capex-table th,
.future-capex-table td {
    padding: 0.875rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.future-capex-table th {
    background: var(--nb-deep);
    color: white;
    font-weight: 600;
}

.future-capex-table tr:nth-child(even) {
    background: #f9fafb;
}

.future-capex-table tr:hover {
    background: rgba(196, 164, 132, 0.05);
}

/* Lifecycle Components */
.lifecycle-component {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.lifecycle-component:hover {
    border-left-color: var(--nb-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.lifecycle-component h4 {
    margin-top: 0;
    color: var(--nb-deep);
    font-size: 1.2rem;
    font-weight: 600;
}

.lifecycle-calculated {
    background: #f0fdf4;
    border: 2px solid #86efac;
    padding: 0.875rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.summary-card:hover {
    border-left-color: var(--nb-gold);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.summary-card h3 {
    margin-top: 0;
    color: var(--nb-deep);
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 3px solid var(--nb-gold);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 3px solid var(--nb-gold);
    color: var(--nb-deep);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-switch input[type="checkbox"] {
    width: 54px;
    height: 28px;
    appearance: none;
    background: #ccc;
    border-radius: 28px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--nb-gold);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked::before {
    left: 28px;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .property-evaluation-container {
        padding: 1rem;
    }

    .progress-stepper {
        padding: 1rem;
        gap: 0.5rem;
    }

    .stepper-step {
        min-width: 80px;
        padding: 0.5rem;
    }

    .stepper-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stepper-label {
        font-size: 0.75rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .section-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    .progress-stepper {
        flex-direction: column;
        align-items: stretch;
    }

    .stepper-step::after {
        display: none;
    }

    .section-content {
        padding: 1.25rem;
    }

    .btn-generate-pdf {
        font-size: 1rem;
        padding: 1rem;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .progress-stepper,
    .section-toggle,
    .btn-proceed,
    .btn-add-row,
    .btn-remove-row,
    .btn-generate-pdf {
        display: none !important;
    }

    .section-collapsed .section-content {
        display: block !important;
    }

    .section-collapsible {
        box-shadow: none;
        break-inside: avoid;
    }
}
