/* RoTaxCalculator - Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Tax Year Selector */
.tax-year-selector {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.year-toggle {
    display: flex;
    gap: 10px;
    background: var(--bg-light);
    padding: 4px;
    border-radius: 8px;
}

.year-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    color: var(--text-dark);
}

.year-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.year-btn.active {
    background: var(--primary-color);
    color: white;
}

.year-info {
    flex: 1;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.year-info p {
    margin: 0;
    font-size: 0.95em;
}

.year-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.year-info a:hover {
    text-decoration: underline;
}

main {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    transition: opacity 0.3s ease;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section.disabled {
    opacity: 0.5;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.drag-handle {
    cursor: grab;
    font-size: 1.2em;
    color: var(--text-muted);
    user-select: none;
    padding: 5px;
    flex-shrink: 0;
    transition: color 0.3s;
}

.drag-handle:hover {
    color: var(--primary-color);
}

.drag-handle:active {
    cursor: grabbing;
}

.form-section.dragging {
    opacity: 0.5;
}

.form-section.drag-over {
    border-top: 3px solid var(--primary-color);
}

.section-toggle {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.section-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5em;
    flex-grow: 1;
}

.section-header h2 label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 1.2em;
    cursor: pointer;
    user-select: none;
    width: 24px;
    text-align: center;
}

.collapse-icon.expanded {
    transform: rotate(90deg);
}

.section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.form-section h3 {
    color: var(--text-dark);
    margin: 20px 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-top: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

/* Results Section */
.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid var(--primary-color);
}

.results-section.hidden {
    display: none;
}

.results-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8em;
}

.result-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.result-card h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.results-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.total-row td {
    background-color: var(--bg-light);
    font-size: 1.1em;
    padding-top: 15px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.subtotal-row td {
    background-color: rgba(37, 99, 235, 0.05);
    font-size: 0.95em;
    padding: 10px 12px !important;
    color: var(--text-muted);
    border-bottom: none !important;
}

.cass-info {
    line-height: 2;
}

.cass-info p {
    margin-bottom: 10px;
}

.cass-collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.9em;
    width: 16px;
    text-align: center;
}

.cass-collapse-icon.expanded {
    transform: rotate(90deg);
}

.cass-brackets-detail {
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid var(--border-color);
}

.cass-bracket-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 0.95em;
}

.cass-bracket-item.inactive {
    color: var(--text-muted);
    opacity: 0.6;
}

.cass-bracket-item.active {
    background-color: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 7px;
}

.net-income-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 0.95em;
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--text-dark);
}

.net-income-item span:first-child {
    font-weight: 500;
}

.net-income-item span:last-child {
    font-weight: 600;
    color: var(--success-color);
}

.cass-amount {
    font-size: 1.2em;
    color: var(--primary-color);
    margin-top: 15px;
}

.tax-owed-amount {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 700;
}

.cass-explanation {
    display: block;
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 6px;
    color: var(--text-dark);
}

.summary-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(29, 78, 216, 0.1));
    border-left-color: var(--success-color);
}

.summary-grid {
    display: grid;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item.total {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: none;
    padding-top: 20px;
    border-top: 2px solid var(--primary-color);
}

.summary-value {
    font-weight: 600;
}

.deadline {
    color: var(--danger-color);
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    margin-top: 40px;
}

footer p {
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .btn-primary, .btn-secondary {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .results-table {
        font-size: 0.9em;
    }

    .results-table th,
    .results-table td {
        padding: 8px 5px;
    }
}

/* Floating Payment Banner */
.floating-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    transition: opacity 0.3s ease-in-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.banner-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.banner-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85em;
    font-weight: 500;
}

.banner-amount {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
}

.banner-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.banner-btn:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: row;
        padding: 12px 15px;
    }

    .banner-amount {
        font-size: 1.2em;
    }

    .banner-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
}

@media print {
    .floating-banner {
        display: none !important;
    }

    body {
        background: white;
    }

    header {
        background: white;
        color: var(--text-dark);
        box-shadow: none;
    }

    .btn-primary, .btn-secondary, #taxForm {
        display: none;
    }

    .results-section {
        display: block !important;
    }

    .result-card {
        page-break-inside: avoid;
    }
}

/* Privacy Modal */
.privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.privacy-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    max-height: 90vh;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.privacy-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.privacy-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.privacy-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.privacy-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.privacy-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.privacy-modal-body h3 {
    color: var(--primary-color);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.privacy-modal-body h3:first-child {
    margin-top: 0;
}

.privacy-modal-body p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: var(--text-dark);
}

.privacy-modal-body ul {
    margin: 12px 0 16px 20px;
    line-height: 1.8;
}

.privacy-modal-body li {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.privacy-modal-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.privacy-modal-body a:hover {
    text-decoration: underline;
}

.privacy-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.privacy-modal-footer .btn-primary {
    margin: 0;
}

@media (max-width: 768px) {
    .privacy-modal {
        padding: 10px;
    }

    .privacy-modal-content {
        max-height: 95vh;
    }

    .privacy-modal-header {
        padding: 20px;
    }

    .privacy-modal-header h2 {
        font-size: 1.2em;
    }

    .privacy-modal-body {
        padding: 20px;
    }

    .privacy-modal-footer {
        padding: 16px 20px;
    }
}

@media print {
    .privacy-modal {
        display: none !important;
    }
}
