/* Base dark theme */
body {
    background-color: #1e1a2b;
    color: #f0f0f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Container padding override */
.container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.text-muted {
    color: #ccc !important;
}

a,
a.text-decoration-none {
    color: #a18bff;
    text-decoration: none;
}

a:hover {
    color: #d0c3ff;
    text-decoration: underline;
}

/* Cards */
.card, .tracker-card {
    background-color: #2b2640;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #f0f0f5;
}

.card-title,
.milestone-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #a18bff; /* lavender-purple */
}

.form-label {
    font-weight: 500;
    color: #ccc;
}

.form-control {
    background-color: #3a3455;
    color: #fff;
    border: 1px solid #554c75;
}

.form-control:focus {
    background-color: #40395d;
    color: #fff;
    border-color: #a18bff;
    box-shadow: 0 0 0 0.2rem rgba(161, 139, 255, 0.25);
}

.btn {
    font-weight: 500;
    font-size: 1.05rem;
    border-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease-in-out;
    border: none;
    color: white;
    background-color: #7a5fff;
}

.btn-primary {
    background-color: #6c4bff;
    color: #fff;
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #7a5fff;
    color: #fff;
}

.btn-outline-secondary {
    background-color: transparent;
    color: #a18bff;
    border: 1px solid #a18bff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: #342f4d;
    color: #fff;
    border-color: #b8aaff;
}

.btn-success {
    background-color: #32c17c;
    color: #fff;
    border: none;
}

.btn-success:hover {
    background-color: #3ed88e;
    color: #fff;
}

.btn-danger {
    background-color: #e05b65;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background-color: #f0767f;
    color: #fff;
}

/* Flash alerts */
.alert {
    border-radius: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background-color: #263c2e;
    color: #b0ffcd;
    border-color: #3ed88e;
}

.alert-danger {
    background-color: #3e1e2a;
    color: #ffb0b0;
    border-color: #e05b65;
}

.alert-warning {
    background-color: #44391e;
    color: #ffe9b0;
    border-color: #d4b23f;
}

/* Navbar */
.navbar {
    background-color: #2a2540;
    border-bottom: 1px solid #3d355a;
}

.nav-link {
    color: #ddd !important;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff !important;
}

/* Other */
.back-btn {
    margin-top: 1.5rem;
}

#loadingIndicator {
    display: none;
    margin-top: 1rem;
}

::placeholder {
    color: #bbb;
    opacity: 1;
}

.form-control::placeholder {
    color: #bbb;
}

select.form-select,
.form-select {
    background-color: #3a3455;
    color: #fff;
    border: 1px solid #554c75;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

select.form-select:focus,
.form-select:focus {
    background-color: #40395d;
    color: #fff;
    border-color: #a18bff;
    box-shadow: 0 0 0 0.2rem rgba(161, 139, 255, 0.25);
}

.modal-content {
    background-color: #2b2640;
    color: #f0f0f5;
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.modal-header,
.modal-footer {
    border: none;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #a18bff;
}

.modal-body textarea.form-control {
    background-color: #3a3455;
    color: #fff;
    border: 1px solid #554c75;
}

.modal-body textarea.form-control:focus {
    background-color: #40395d;
    border-color: #a18bff;
    box-shadow: 0 0 0 0.2rem rgba(161, 139, 255, 0.25);
    color: #fff;
}

/* App Footer */
.app-footer {
    background-color: #2a2540;
    color: #f0f0f5;
    border-top: 1px solid #3d355a;
}

.app-footer a.footer-link {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.app-footer a.footer-link:hover {
    color: #a18bff;
    text-decoration: underline;
}

.selectable-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.selectable-card:hover {
    border-color: #b8aaff; /* Slightly brighter than selected lavender */
    background-color: #3a3455; /* Slightly lighter than the card background */
    box-shadow: 0 0 8px rgba(161, 139, 255, 0.3); /* Soft lavender glow */
}

.btn-check:checked + .selectable-card {
    border-color: #a18bff;
    background-color: #2b2640;
    box-shadow: 0 0 0 2px rgba(161, 139, 255, 0.4); /* Focus ring feel */
}

.form-control-disabled {
    background-color: #3a3455 !important; /* match .form-control */
    color: #ccc !important; /* improve contrast */
    opacity: 1 !important; /* override default dimming */
    cursor: not-allowed;
}

/* Fix disabled buttons in dark theme */
button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #3c345e !important; /* subtle contrast against card bg */
    border-color: #5d4ea3 !important;
    color: #bbb !important;
    box-shadow: none;
}

/* Pricing Table Specific */
.pricing-card {
    background-color: #2b2640;
    color: #f0f0f5;
    border: 2px solid transparent;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pricing-card:hover {
    border-color: #b8aaff;
    background-color: #3a3455;
    box-shadow: 0 0 10px rgba(161, 139, 255, 0.3);
}

.pricing-card.selected {
    border-color: #a18bff;
    background-color: #2b2640;
    box-shadow: 0 0 0 3px rgba(161, 139, 255, 0.4);
}

.pricing-card .card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #a18bff;
}

.pricing-card ul {
    padding-left: 0;
    list-style: none;
}

.pricing-card ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.btn-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Hide radios */
.visually-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.display-5-strong {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* subtle shadow improves readability */
    color: #a18bff;
}

.display-4-strong {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* subtle shadow improves readability */
    color: #a18bff;
}

.navbar-brand-contrast {
    color: #fff !important;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
    color: #f0f0f5;
    font-size: 0.95rem;
}

.table th,
.table td {
    background-color: #2b2640 !important; /* ensure dark bg */
    color: #f0f0f5 !important; /* force light text */
    border: 1px solid #3d355a !important; /* subtle grid lines */
    vertical-align: middle;
    padding: 0.75rem;
}

.table thead th {
    background-color: #2b2640 !important;
    color: #a18bff !important; /* lavender headers */
    font-weight: 600;
    border-bottom: 2px solid #554c75;
}

.table-hover tbody tr:hover td {
    background-color: #3a3455 !important;
}

.table-sm td,
.table-sm th {
    padding: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}