/* TrusFund CSS - Complete Responsive Styles */

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

:root {
    --primary-blue: #00b4d8;
    --dark-blue: #1e3a5f;
    --darker-blue: #0a192f;
    --light-blue: #90e0ef;
    --bg-gradient-start: #caf0f8;
    --bg-gradient-end: #ade8f4;
    --text-dark: #1a202c;
    --text-light: #718096;
    --white: #ffffff;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #2d3748;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ==================== Page Management ==================== */
.page {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* ==================== Navbar ==================== */
.navbar {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 101;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark-blue);
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 80px 20px 20px;
    transition: right 0.3s ease;
    z-index: 99;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 10px;
}

/* ==================== Buttons ==================== */
.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
    background: #0096b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 180, 216, 0.4);
}

.btn-hero {
    background: var(--primary-blue);
    color: var(--white);
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 180, 216, 0.5);
}

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

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

.btn-full {
    width: 100%;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(0, 180, 216, 0.1);
}

/* ==================== Hero Section ==================== */
.hero {
    padding: 80px 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ==================== Core Mission Section ==================== */
.core-mission {
    padding: 80px 0;
    background: var(--white);
}

.core-mission h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--dark-blue);
    margin-bottom: 60px;
}

.mission-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.mission-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    border: 2px solid var(--primary-blue);
    text-align: center;
    transition: all 0.3s;
}

.mission-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 180, 216, 0.2);
}

.mission-icon {
    margin-bottom: 20px;
}

.mission-card h3 {
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 15px;
}

.mission-card p {
    color: var(--text-light);
}

/* ==================== Why TrusFund Section ==================== */
.why-trusfund {
    padding: 80px 0;
    background: var(--dark-blue);
    color: var(--white);
}

.why-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.why-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.why-text p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
}

.calculator {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.calculator label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.calculator input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    margin-bottom: 15px;
}

.calc-result {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--light-blue);
}

.why-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--light-blue);
    margin-bottom: 10px;
}

.stat-item p {
    color: rgba(255, 255, 255, 0.8);
}

/* ==================== Footer ==================== */
footer {
    background: var(--darker-blue);
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.footer-social a:hover {
    background: var(--primary-blue);
    transform: translateY(-3px);
}

.footer-copy {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== Auth Pages (Login/Signup) ==================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    max-width: 900px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-left {
    padding: 60px 50px;
}

.auth-left h2 {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.auth-right {
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-right::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.auth-quote {
    position: relative;
    z-index: 1;
}

.auth-quote p {
    font-size: 1.3rem;
    color: var(--white);
    font-style: italic;
    line-height: 1.8;
}

.link-secondary {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 30px;
}

.link-secondary:hover {
    text-decoration: underline;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: 'Poppins', sans-serif;
}

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

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
}

.security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 15px;
    background: rgba(0, 180, 216, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==================== Dashboard Layout ==================== */
#dashboard-page {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: var(--bg-gradient-start);
}

#dashboard-page.active {
    display: grid;
}

/* ==================== Sidebar ==================== */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: var(--primary-blue);
}

.sidebar-link.active {
    background: var(--primary-blue);
    color: var(--white);
    border-left-color: var(--light-blue);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-link.logout {
    color: #ff6b6b;
}

.sidebar-link.logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* ==================== Dashboard Main Content ==================== */
.dashboard-main {
    margin-left: 250px;
    padding: 30px;
    width: calc(100% - 250px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--white);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: var(--dark-blue);
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-dash {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger-dash span {
    width: 25px;
    height: 3px;
    background: var(--dark-blue);
    transition: all 0.3s;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* ==================== Dashboard Sections ==================== */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* ==================== Stats Cards ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 180, 216, 0.2);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    color: var(--primary-blue);
    font-weight: 700;
}

/* ==================== Quick Actions ==================== */
.quick-actions {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quick-actions h3 {
    margin-bottom: 20px;
    color: var(--dark-blue);
}

.action-buttons {
    display: flex;
    gap: 20px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.3);
}

/* ==================== Tables ==================== */
.table-container {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.table-container h3 {
    margin-bottom: 20px;
    color: var(--dark-blue);
}

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

.investment-table thead {
    background: rgba(0, 180, 216, 0.1);
}

.investment-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-blue);
}

.investment-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.investment-table tbody tr:hover {
    background: rgba(0, 180, 216, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.status-completed {
    background: rgba(0, 180, 216, 0.2);
    color: var(--primary-blue);
}

.status-pending {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

/* ==================== Investment Form ==================== */
.invest-form-container {
    max-width: 600px;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.invest-form-container h2 {
    margin-bottom: 30px;
    color: var(--dark-blue);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.estimated-return {
    background: rgba(0, 180, 216, 0.1);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.estimated-return p {
    font-size: 1.2rem;
    color: var(--text-dark);
}

.estimated-return strong {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.profit-percent {
    color: var(--success);
    font-size: 1rem;
    margin-top: 5px;
}

/* ==================== Referral Section ==================== */
.referral-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.referral-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.referral-code {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.referral-code input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-blue);
    text-align: center;
}

.btn-copy {
    padding: 12px 24px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ref-stat {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.ref-stat h4 {
    color: var(--text-light);
    margin-bottom: 10px;
}

.ref-value {
    font-size: 2rem;
    color: var(--primary-blue);
    font-weight: 700;
}

/* ==================== Settings Section ==================== */
.settings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.settings-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

/* ==================== Modal ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    color: var(--dark-blue);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

/* ==================== Responsive Design ==================== */

/* Tablet */
@media (max-width: 968px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    .hero-content,
    .why-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mission-cards {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-right {
        display: none;
    }

    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .hamburger-dash {
        display: flex;
    }

    .referral-container,
    .settings-container {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .core-mission h2,
    .why-text h2 {
        font-size: 1.8rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .dashboard-header h1 {
        font-size: 1.3rem;
    }

    .table-container {
        padding: 15px;
    }

    .investment-table {
        font-size: 0.85rem;
    }

    .investment-table th,
    .investment-table td {
        padding: 10px 5px;
    }

    .auth-left {
        padding: 40px 30px;
    }

    .invest-form-container {
        padding: 30px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .referral-stats {
        grid-template-columns: 1fr;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 0;
    }

    .core-mission,
    .why-trusfund {
        padding: 40px 0;
    }

    .modal-content {
        width: 95%;
    }

    .dashboard-header {
        padding: 15px;
    }

    .stat-card {
        padding: 20px;
    }
}
