:root {
    --primary-color: #3366ff;
    --primary-dark: #2952cc;
    --primary-gradient: linear-gradient(135deg, #3366ff 0%, #5e83ff 100%);
    --secondary-color: #6c63ff;
    --text-color: #333333;
    --text-light: #666666;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --button-shadow: 0 4px 10px rgba(51, 102, 255, 0.3);
    --border-radius: 8px;
}

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

body {
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

p {
    margin-bottom: 20px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    box-shadow: var(--button-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(51, 102, 255, 0.4);
}

/* Header navigation button specific styles */
nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 60px;
}

nav ul li {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

nav ul li:last-child {
    margin-left: auto;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 5px;
}

nav ul li a:not(.btn-secondary) {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.2px;
    padding-top: 3px;
}

nav ul li a:not(.btn-secondary)::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav ul li a:not(.btn-secondary):hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Auth container styles */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    padding: 8px 0;
    margin-top: -4px;
}

/* Update the secondary button style for Log In */
nav ul li a.btn-secondary {
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: var(--button-shadow);
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

nav ul li a.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(51, 102, 255, 0.4);
}

/* Regular secondary button (not in nav) */
.btn-secondary:not(nav ul li a) {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:not(nav ul li a):hover {
    background-color: rgba(51, 102, 255, 0.1);
}

/* Header */
header {
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-image {
    height: 40px;
    width: auto;
    margin-right: 12px;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 100px 0;
    text-align: center;
    background-color: var(--white);
}

.hero h1 {
    margin-bottom: 20px;
}

.subheadline {
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto 40px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.hero .btn-primary,
.hero .btn-secondary {
    padding: 14px 32px;
    font-size: 1.1rem;
    border-radius: 30px;
    box-shadow: var(--button-shadow);
    letter-spacing: 0.5px;
}

.hero .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(51, 102, 255, 0.5);
}

.hero .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(51, 102, 255, 0.3);
}

/* Features Section */
.features {
    padding: 100px 0;
    background-color: var(--background-color);
}

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

.feature-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Audience Section */
.audience {
    padding: 100px 0;
    background-color: var(--white);
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.audience-card {
    background-color: var(--background-color);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.audience-card:hover {
    transform: translateY(-5px);
}

.audience-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.audience-card p {
    font-size: 1.1rem;
}

/* Signup Section */
.signup {
    padding: 100px 0;
    background-color: var(--background-color);
    text-align: center;
}

form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: left;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: "Inter", sans-serif;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

button[type="submit"] {
    width: 100%;
    margin-top: 10px;
    font-size: 1rem;
    background: var(--primary-gradient);
    border-radius: 30px;
    padding: 14px;
    box-shadow: var(--button-shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(51, 102, 255, 0.4);
    background: linear-gradient(135deg, #2952cc 0%, #4a73f8 100%);
}

/* Footer */
footer {
    background-color: var(--white);
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
}

/* Media Queries */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    nav ul {
        display: none;
    }

    .hero,
    .features,
    .audience,
    .signup {
        padding: 60px 0;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .hero .btn-primary,
    .hero .btn-secondary {
        min-width: 200px;
    }

    form {
        padding: 30px;
    }

    nav.active ul li {
        margin: 10px 0;
        height: auto;
    }

    nav.active ul li a {
        height: auto;
        padding: 10px 5px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .subheadline {
        font-size: 1.1rem;
    }

    .feature-icon {
        font-size: 2.5rem;
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    nav.active ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 20px;
    }

    nav.active ul li {
        margin: 10px 0;
    }
}

/* Delete Confirmation Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 0;
    box-sizing: border-box;
}

.delete-confirmation-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow: auto;
    transform: scale(1);
    transition: transform 0.3s ease;
    position: relative;
    margin: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.delete-warning {
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.delete-warning p {
    margin: 0 0 1rem;
    color: #374151;
    font-size: 1rem;
}

.property-preview {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #ef4444;
}

.property-preview strong {
    color: #111827;
    font-size: 1.1rem;
}

.warning-text {
    color: #ef4444 !important;
    font-weight: 500;
    font-size: 0.9rem !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.success-message.show {
    transform: translateX(0);
}

.success-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Ensure the success message appears */
.success-message {
    transform: translateX(0);
}

/* Responsive styles for delete confirmation modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }

    .delete-confirmation-modal {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        margin: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 5px;
    }

    .delete-confirmation-modal {
        max-height: 98vh;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .warning-icon {
        font-size: 2.5rem;
    }
}

/* Scenario tab: scenario switcher + owner filter */
.scenario-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 18px;
}

.scenario-select-wrap,
.scenario-owner-filter-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scenario-delete-btn-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.scenario-select-wrap label,
.scenario-owner-filter-wrap label {
    font-size: 1.01rem;
    color: #444;
    margin: 0;
}

.scenario-select-modern,
.scenario-owner-filter-select {
    min-width: 200px;
    max-width: min(420px, 100%);
    padding: 7px 14px;
    border-radius: 7px;
    border: 1.5px solid #e0e7ef;
    font-size: 1rem;
    background: #fff;
}

.scenario-properties-header {
    display: flex;
    align-items: center;
    gap: 1.5em;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}

.scenario-properties-header .property-sort-wrapper {
    margin-left: auto;
}

.scenario-properties-header #add-more-properties-link {
    margin-left: 1em;
}

.portfolio-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portfolio-top-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 18px;
}

.portfolio-top-controls-row .negative-gearing-toggle-row {
    margin-bottom: 0;
}

.portfolio-refresh-valuations-btn {
    font-size: 0.97rem;
    padding: 7px 18px;
    min-height: 40px;
    line-height: 1.2;
    white-space: nowrap;
}

.negative-gearing-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.toggle-label {
    font-size: 1.05rem;
    color: #222;
    margin-right: 6px;
}

.toggle-switch {
    display: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s;
    cursor: pointer;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch:checked + .toggle-slider {
    background: #16b1a6;
}

.toggle-switch:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch-label {
    display: inline-block;
    position: relative;
    cursor: pointer;
}

/* Dashboard toasts (replaces native alert for refresh flow) */
#dashboard-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.dashboard-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
    animation: dashboardToastIn 0.28s ease;
}

.dashboard-toast--success {
    border-left-color: #16a34a;
}

.dashboard-toast--error {
    border-left-color: #dc2626;
}

.dashboard-toast--warning {
    border-left-color: #ca8a04;
}

.dashboard-toast--info {
    border-left-color: var(--primary-color);
}

.dashboard-toast__message {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
}

.dashboard-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 0 0 4px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.dashboard-toast__close:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.05);
}

.dashboard-toast--out {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.dashboard-refresh-confirm .dashboard-refresh-confirm__body {
    margin: 0;
    color: #374151;
    font-size: 1rem;
    line-height: 1.55;
}

@media (max-width: 480px) {
    #dashboard-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}
