/* =====================================================
   Algofy Wealth v1 - Main Stylesheet
   Professional financial planning interface
   ===================================================== */

/* ===== Root Variables ===== */
:root {
    --primary-color: #1F4788;
    --secondary-color: #28A745;
    --accent-color: #FFC107;
    --danger-color: #DC3545;
    --light-bg: #F8F9FA;
    --dark-text: #212529;
    --muted-text: #6C757D;
    --border-color: #DEE2E6;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ===== Header/Navbar ===== */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.navbar-nav a:hover {
    opacity: 0.8;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: var(--dark-text);
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: var(--dark-text) !important;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--dark-text) !important;
    background-color: #f8f9fa;
    opacity: 1;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

.dropdown {
    position: relative;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    margin: 0;
    color: var(--primary-color);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 71, 136, 0.1);
}

.form-control:disabled {
    background-color: #E9ECEF;
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--muted-text);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background-color: #163761;
}

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

.btn-success:hover {
    background-color: #218838;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-block {
    width: 100%;
}

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

/* ===== Grid System ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 15px;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

/* ===== Dashboard ===== */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color), #2B5AA0);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-positive {
    color: var(--secondary-color);
}

.stat-negative {
    color: var(--danger-color);
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table thead {
    background-color: var(--light-bg);
}

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

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

.table tbody tr:hover {
    background-color: #F8F9FA;
}

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

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #D4EDDA;
    border-color: var(--secondary-color);
    color: #155724;
}

.alert-danger {
    background-color: #F8D7DA;
    border-color: var(--danger-color);
    color: #721C24;
}

.alert-warning {
    background-color: #FFF3CD;
    border-color: var(--accent-color);
    color: #856404;
}

.alert-info {
    background-color: #D1ECF1;
    border-color: #17A2B8;
    color: #0C5460;
}

/* ===== Loading Spinner ===== */
.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 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Charts Container ===== */
.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

.chart-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

/* ===== Login/Register Pages ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    max-width: 450px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ===== Landing Page ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #2B5AA0);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        gap: 1rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    .hero h1 {
        font-size: 2rem;
    }

    .chart-container {
        height: 300px;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted-text); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--secondary-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 1rem; }

/* ===== Retirement Plan Value Cards ===== */
.plan-value-card {
    padding: 0.85rem 1rem;
    background-color: #F8F9FA;
    border-radius: 8px;
    height: 100%;
}

/* ===== Edit Plan Button (permanent rounded rectangle, no hover change) ===== */
.btn-edit-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-text);
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: none;
    flex-shrink: 0;
}
.btn-edit-plan:hover,
.btn-edit-plan:focus,
.btn-edit-plan:active {
    background-color: transparent;
    color: var(--muted-text);
    border-color: var(--border-color);
    outline: none;
    box-shadow: none;
}

