@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

:root {
    --bg-project: #f2f2f2;
    --bg-content: #edede9;
    --bg-menu: #3e5c79;
    --bg-secondary: #9cadbb;
    --color-icon: #efa73f;
    --color-text: #333333;
    --color-active-blue: #0d6efd;
    /* Bright blue for active tab */
    --font-main: 'Poppins', sans-serif;
}

html {
    height: 100%;
}

body {
    background-color: var(--bg-project);
    color: #333333 !important;
    /* Enforce requested color */
    font-family: var(--font-main);
    font-weight: 200;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.d-flex.flex-column.flex-md-row {
    flex: 1;
    overflow: hidden;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div,
a,
li,
td,
th {
    color: #333333;
}

.text-white {
    color: white !important;
}

.text-primary {
    color: var(--bg-menu) !important;
    /* Adjust primary text to match menu color or keep dark */
}

h1,
h2,
h3,
h4,
h5,
h6,
.title,
strong,
b {
    font-weight: 400;
}

.sidebar {
    background-color: var(--bg-menu);
    min-height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    color: white;
    width: 18%;
    /* Reduced from 20% for more elegant proportions */
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 40px;
    padding-left: 20px;
    padding-right: 0;
    padding-bottom: 60px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .fs-4 {
    padding-left: 10px;
    margin-bottom: 40px;
    display: block;
}

.sidebar hr {
    display: none;
}

.main-content {
    margin-left: 18%;
    /* Match sidebar width */
    width: 82%;
    padding: 20px;
    background-color: var(--bg-project);
    overflow-y: auto;
    height: 100%;
}

.content-card {
    background-color: var(--bg-content);
    border-radius: 40px;
    /* Large rounded corners as requested */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 40px;
    flex-grow: 1;
    margin-top: 10px;
    margin-bottom: 10px;
}

.nav-link {
    color: white;
    padding: 15px 0 15px 25px;
    margin-bottom: 15px;
    /* Increased spacing for smoother look */
    border-radius: 30px 0 0 30px;
    /* Rounded left, flat right */
    transition: all 0.3s ease;
    font-weight: 400;
    display: flex;
    align-items: center;
    position: relative;
    background-color: transparent;
    margin-right: 0;
    /* Touch the edge */
    border: 1px solid transparent;
    /* Prevent layout shift */
}

/* Active State - The "Tab" Look */
.nav-link.active {
    background-color: #f2f2f2 !important;
    color: #333333 !important;
    font-weight: 600;
    box-shadow: none;
    border-radius: 30px 0 0 30px;
    position: relative;
    margin-right: -70px;
    /* Extend past sidebar */
    padding-right: 70px;
    /* Compensate for extension */
    margin-left: 0;
    padding-left: 25px;
    /* Restore original padding */
    z-index: 1050;
    /* Ensure it sits above everything */
}

/* Curves above and below active tab using Radial Gradient for perfect concave shape */
.nav-link.active::before,
.nav-link.active::after {
    content: "";
    position: absolute;
    right: 50px;
    /* Exactly at the sidebar edge */
    width: 50px;
    height: 50px;
    background-color: transparent;
    pointer-events: none;
    z-index: 1;
}

/* Top Curve: Concave (Inverted) Radius */
.nav-link.active::before {
    top: -50px;
    background-image: radial-gradient(circle at top left, transparent 50px, #f2f2f2 10.5px);
}

/* Bottom Curve: Concave (Inverted) Radius */
.nav-link.active::after {
    bottom: -50px;
    background-image: radial-gradient(circle at bottom left, transparent 50px, #f2f2f2 10.5px);
}

.nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link i {
    color: var(--color-icon);
    margin-right: 15px;
    width: 25px;
    text-align: center;
    font-size: 1.2em;
}

.nav-link.active i {
    color: #ffc107;
    /* Yellow icon for active state */
}

/* Logo Area */
.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-left: 10px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border: 1px solid white;
    border-radius: 50%;
    padding: 5px;
    margin-right: 10px;
}

.btn-primary {
    background-color: #9cadbb !important;
    border-color: #9cadbb !important;
    color: #333333 !important;
    border-radius: 25px;
    padding: 10px 30px;
    font-weight: 400;
}

.btn-primary:hover {
    background-color: #8b9cae !important;
    border-color: #8b9cae !important;
    color: #333333 !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #7a8b9d !important;
    border-color: #7a8b9d !important;
    color: #333333 !important;
    box-shadow: 0 0 0 0.2rem rgba(156, 173, 187, 0.5) !important;
}

.btn-outline-primary {
    border-color: #9cadbb !important;
    color: #9cadbb !important;
    border-radius: 25px;
}

.btn-outline-primary:hover {
    background-color: #9cadbb !important;
    border-color: #9cadbb !important;
    color: #333333 !important;
}

.btn-outline-secondary {
    border-radius: 25px;
}

.btn-donate {
    background-color: #efa73f !important;
    border-color: #efa73f !important;
    color: #333333 !important;
    border-radius: 25px;
    padding: 10px 30px;
    font-weight: 400;
}

.btn-donate:hover {
    background-color: #d99636 !important;
    border-color: #d99636 !important;
    color: #333333 !important;
}

/* Wizard Steps */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 15px;
    border: 1px solid #e0e0e0;
    padding: 12px 20px;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(156, 173, 187, 0.2);
    border-color: var(--bg-secondary);
}

/* Cards inside content */
.card {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    /* Mobile header bar to show toggle button */
    body::before {
        content: '';
        display: block;
        height: 60px;
        background-color: var(--bg-menu);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1500;
    }

    #sidebarToggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1600;
        background-color: transparent;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 0 !important;
        margin-bottom: 5px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        left: 0;
        top: 0;
        min-height: auto;
        max-height: none;
        padding: 15px;
        background-color: var(--bg-menu);
        z-index: 2000;
        overflow-y: visible;
        overflow-x: hidden;
    }

    /* Show logo and toggle button */
    .sidebar .logo-container {
        display: flex !important;
        margin-bottom: 0 !important;
    }

    #sidebarToggle {
        display: block !important;
    }

    /* Hide menu items by default */
    .sidebar .nav,
    .sidebar .dropdown {
        display: none;
        flex-direction: column;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* User dropdown specific styles for mobile */
    .sidebar .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        border: none;
        background-color: rgba(255, 255, 255, 0.1);
        margin-top: 5px;
    }

    /* Show menu when sidebar has 'show' class */
    .sidebar.show .nav,
    .sidebar.show .dropdown {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
        padding-top: 180px;
        min-height: calc(100vh - 200px);
    }

    /* When menu is open, adjust main content */
    .sidebar.show~.main-content {
        padding-top: 300px;
    }

    .content-card {
        border-radius: 30px;
        padding: 25px;
        margin-top: 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    /* Reset Nav Link Styles for Mobile */
    .nav-link {
        border-radius: 10px;
        /* Simple rounded corners */
        margin-right: 0;
        margin-bottom: 5px;
        padding: 12px 15px;
        justify-content: flex-start;
    }

    /* Disable the seamless tab effect on mobile */
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        /* Translucent active state */
        color: white;
        font-weight: 500;
        border-radius: 10px;
        box-shadow: none;
    }

    .nav-link.active::before,
    .nav-link.active::after {
        display: none;
        /* Hide curves */
    }

    .nav-link:hover {
        transform: none;
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* Adjust Logo */
    .logo-container {
        margin-bottom: 20px;
    }

    .sidebar .fs-4 {
        font-size: 1.2rem !important;
    }

    /* Form adjustments */
    .form-control {
        background-color: #ffffff;
        border: none;
        padding: 15px;
    }

    .btn-primary {
        width: 100%;
        padding: 12px;
        font-size: 1.1rem;
    }

    /* Prevent horizontal scroll on mobile by converting tables to cards */
    .table-responsive {
        border: 0;
    }

    .table-responsive table {
        border: 0;
    }

    .table-responsive thead {
        display: none;
        /* Hide table headers */
    }

    .table-responsive tr {
        display: block;
        margin-bottom: 20px;
        background-color: #fff;
        border-radius: 15px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        padding: 15px;
        border: 1px solid #eee;
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
        padding: 10px 0;
        font-size: 0.9rem;
        text-align: right;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 15px;
        color: #666;
        flex-shrink: 0;
    }

    /* Adjust buttons in card view */
    .table-responsive td .btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .table-responsive td .d-flex {
        justify-content: flex-end;
        width: 100%;
    }
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    display: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--bg-menu);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#backToTop:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#backToTop:active {
    transform: translateY(-2px) scale(1.02);
}

#backToTop i {
    font-size: 22px;
    line-height: 1;
}

/* Social Share Buttons */
.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-menu);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
}

.btn-social:hover {
    background-color: var(--bg-secondary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.social-share-buttons {
    flex-wrap: wrap;
}

/* Footer Styles */
footer {
    width: 100vw;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    margin-left: 0;
    left: 0;
}

footer p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}