/**
 * Australian Investment Property Calculator - Stylesheet
 * Copyright (c) 2025 Rowel Uchi. All Rights Reserved.
 * 
 * This software is proprietary and confidential.
 * Unauthorized copying, distribution, modification, or use of this software,
 * via any medium, is strictly prohibited without written permission.
 */

/* Modern Design System - Updated 2025 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f7fafc;
    min-height: 100vh;
    padding: 20px;
    color: #222;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
}

header p {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 500;
    color: white;
}

.tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tab-button {
    flex: 1;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    margin: 0 2px;
}

.tab-button:hover {
    background: #f7fafc;
    color: #667eea;
}

.tab-button.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 3px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

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

h2 {
    color: #2B6CB0;
    font-size: 2em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}

h3 {
    color: #3182ce;
    font-size: 1.5em;
    margin: 30px 0 20px 0;
    font-weight: 700;
}

h4 {
    color: #2d3748;
    font-size: 1.2em;
    margin: 24px 0 16px 0;
    font-weight: 600;
}

/* Section Card - Groups related form fields */
.section-card {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.section-card h4 {
    margin-top: 20px;
    color: #4a5568;
    font-size: 1.1em;
}

.section-card:first-of-type {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e0;
}

.form-group small {
    margin-top: 6px;
    color: #718096;
    font-size: 12px;
    line-height: 1.4;
}

/* Tooltip for cost breakdown */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    background: #3182ce;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    transition: background 0.2s ease;
}

.info-icon:hover {
    background: #2563eb;
}

.hover-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    min-width: 250px;
    text-align: left;
}

.hover-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1a202c transparent transparent transparent;
}

.tooltip-container:hover .hover-tooltip {
    visibility: visible;
    opacity: 1;
}

.toggle-link {
    color: #3182ce;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 8px;
    font-weight: 600;
}

.toggle-link:hover {
    color: #2563eb;
}

/* Checkbox Styling - Mobile Friendly */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
    accent-color: #3182ce;
    flex-shrink: 0;
}

/* Larger checkboxes on mobile for better touch targets */
@media (max-width: 768px) {
    input[type="checkbox"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
}

.tooltip-breakdown {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-breakdown li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-breakdown li:last-child {
    border-bottom: none;
    margin-top: 6px;
    padding-top: 8px;
    font-weight: 700;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}


.summary-box {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin: 30px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(49, 130, 206, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-box:hover {
    box-shadow: 0 8px 32px rgba(49, 130, 206, 0.12);
    transform: translateY(-2px);
}

.summary-box h3 {
    margin-top: 0;
    color: #2B6CB0;
    font-weight: 700;
}

.summary-box p {
    margin: 12px 0;
    font-size: 16px;
    color: #2d3748;
}

.summary-box strong {
    color: #1a202c;
    font-weight: 600;
}

.summary-box table {
    width: 100%;
    margin-top: 16px;
}

.summary-box table td {
    padding: 10px 0;
    font-size: 15px;
    color: #2d3748;
}

.summary-box table td:last-child {
    text-align: right;
    font-weight: 600;
}

.info-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.info-box h3 {
    margin-top: 0;
    color: #5a67d8;
    font-size: 1.3em;
    font-weight: 700;
}

.info-box p {
    margin: 8px 0;
    line-height: 1.6;
    color: #2d3748;
}

.table-container {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: linear-gradient(135deg, #2B6CB0 0%, #3182ce 100%);
    color: white;
}

table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid #cbd5e0;
    transition: background 0.15s ease;
}

table tbody tr:hover {
    background: #f7fafc;
}

table tbody tr.current-rate {
    background: #fef3c7;
}

table tbody tr.current-rate:hover {
    background: #ffe0b2;
}

table td {
    padding: 14px 16px;
    font-size: 14px;
}

.badge {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.positive {
    color: #059669;
    font-weight: 600;
}

.negative {
    color: #dc2626;
    font-weight: 600;
}

.total-row {
    background: #f7fafc;
    font-weight: bold;
    border-top: 2px solid #3182ce;
}

.highlight-row {
    background: #ebf8ff;
    font-weight: bold;
    border-top: 2px solid #3182ce;
}

.highlight-row td {
    padding: 16px;
}

.column h4 {
    color: #2B6CB0;
    font-size: 1.2em;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin: 24px 0;
}

.column {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.column:hover {
    box-shadow: 0 4px 18px rgba(49, 130, 206, 0.08);
}

.column h3 {
    margin-top: 0;
    color: #2B6CB0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(102, 126, 234, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
}

.metric-card h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    opacity: 0.95;
    color: white;
}

.metric-value {
    font-size: 2.2em;
    font-weight: 800;
    margin: 8px 0;
}

.metric-label {
    font-size: 14px;
    opacity: 0.9;
    margin: 8px 0 0 0;
    font-weight: 500;
}

.highlight {
    font-weight: 700;
    font-size: 17px;
}

footer {
    background: #f7fafc;
    padding: 24px 40px;
    text-align: center;
    color: #718096;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px !important;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    /* Stack header title and button vertically on mobile */
    .header-title-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .clear-data-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 10px 16px !important;
        font-size: 0.9em !important;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
    }
    
    .tabs {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        page-break-after: always;
    }
    
    .metric-card {
        break-inside: avoid;
    }
}

/* ATO Lodgement Tab Styles */
.ato-section {
    margin: 24px 0;
}

.ato-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

.ato-table thead {
    background: linear-gradient(135deg, #2B6CB0 0%, #3182ce 100%);
    color: white;
}

.ato-table th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
}

.ato-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.ato-table tbody tr:hover {
    background: #f7fafc;
}

.ato-table td {
    padding: 12px;
    font-size: 14px;
    color: #2d3748;
}

.ato-table td:first-child {
    font-weight: 600;
    color: #2B6CB0;
}

.ato-result {
    font-size: 16px;
    font-weight: 700;
}

.ato-warnings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 16px;
    border-radius: 4px;
}

.warning-box h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.warning-box p,
.warning-box ul {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.warning-box ul {
    padding-left: 20px;
}

.warning-box li {
    margin: 4px 0;
}

.ato-impact {
    font-size: 18px;
    font-weight: 700;
    color: #1e3c72;
}

/* 5-Year Projection Styles */
.projection-config {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.projection-config h3 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 18px;
}

.projection-config h4 {
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 16px;
}

.projection-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transition: transform 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.summary-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .metric-value {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0;
    letter-spacing: -1px;
}

.summary-card .metric-label {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 8px;
}

.projection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 20px;
}

.projection-table th {
    background: #2B6CB0;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #1e4a7a;
    font-size: 12px;
    line-height: 1.3;
}

.projection-table th[rowspan] {
    vertical-align: middle;
    min-width: 50px;
}

.projection-table td {
    padding: 10px 8px;
    text-align: right;
    border: 1px solid #cbd5e0;
}

.projection-table tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

.projection-table tbody tr:hover {
    background: #e6f3ff;
}

.projection-table tfoot tr {
    background: #edf2f7;
    font-weight: 700;
    border-top: 3px solid #2B6CB0;
}

.projection-table tfoot td {
    padding: 12px 8px;
    font-weight: 700;
}

/* Cash flow color coding */
.positive-flow {
    color: #22c55e;
    font-weight: 600;
}

.negative-flow {
    color: #ef4444;
    font-weight: 600;
}

.neutral-flow {
    color: #f59e0b;
    font-weight: 600;
}

/* Year column styling */
.projection-table td:first-child {
    text-align: center;
    font-weight: 700;
    background: #f1f5f9;
    color: #2B6CB0;
}

/* Responsive table */
@media (max-width: 1200px) {
    .projection-table {
        font-size: 11px;
    }
    
    .projection-table th,
    .projection-table td {
        padding: 8px 4px;
    }
}

@media (max-width: 768px) {
    .projection-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .summary-card .metric-value {
        font-size: 28px;
    }
    
    .projection-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .projection-config .form-grid {
        grid-template-columns: 1fr;
    }
}
