/* Global Nordic Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

body {
    background-color: var(--nordic-bg);
    color: var(--nordic-text);
    font-family: 'Outfit', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    accent-color: var(--nordic-sage);
    /* Themes native inputs like calendar, range, checkbox */
}

/* Customizing the native date picker icon to match theme */
::-webkit-calendar-picker-indicator {
    filter: invert(34%) sepia(16%) saturate(664%) hue-rotate(106deg) brightness(93%) contrast(87%);
    /* Approximate filter for #84a98c (Nordic Sage) */
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--nordic-slate);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: var(--nordic-slate);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--nordic-sage);
}

/* Bootstrap Overrides - Nordic Theme */

/* Buttons */
.btn-primary {
    background-color: var(--nordic-slate);
    border-color: var(--nordic-slate);
    color: white;
    border-radius: 16px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.2);
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1d3540 !important;
    border-color: #1d3540 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(38, 70, 83, 0.3);
}

.btn-outline-primary {
    color: var(--nordic-slate);
    border-color: var(--nordic-border);
    border-width: 2px;
    border-radius: 16px;
    padding: 0.7rem 1.8rem;
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked+.btn-outline-primary,
.btn-check:active+.btn-outline-primary {
    background-color: var(--nordic-slate);
    border-color: var(--nordic-slate);
    color: white;
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.2);
}

.btn-check:focus+.btn-outline-primary,
.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(38, 70, 83, 0.25);
}

.btn-secondary {
    background-color: #e9ecef;
    /* Lighter grey */
    border-color: #e9ecef;
    color: var(--nordic-slate);
    border-radius: 16px;
    padding: 0.8rem 2rem;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #dee2e6;
    border-color: #dee2e6;
    color: var(--nordic-slate);
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #dee2e6;
    border-width: 1px;
    /* Thinner border for cleaner look */
    border-radius: 16px;
    padding: 0.7rem 1.8rem;
    font-weight: 500;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary.active {
    background-color: var(--nordic-slate);
    border-color: var(--nordic-slate);
    color: white;
}

/* Cards */
.card {
    background: var(--nordic-surface);
    border: 1px solid var(--nordic-border);
    border-radius: 24px;
    padding: 1.5rem;
    /* Slightly less padding than custom to respect bootstrap layout */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: none;
    /* Reset default bootstrap shadow if any */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--nordic-border);
    transition: background 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--nordic-shadow) !important;
    border-color: rgba(132, 169, 140, 0.3);
}

.card:hover::before {
    background: var(--nordic-sage);
}

/* Specific Card Overrides for Layouts */
.card-body {
    padding: 1rem;
}

/* Badges */
.badge {
    border-radius: 99px;
    padding: 0.5em 1em;
    font-weight: 600;
}

/* Progress Bars */
.progress {
    background-color: #f0f4f1;
    /* Soft Nordic background */
    border-radius: 99px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: 99px;
    background: linear-gradient(90deg, var(--nordic-sage) 0%, #2a9d8f 100%);
    box-shadow: 0 2px 4px rgba(42, 157, 143, 0.3);
}

.progress-bar.bg-gradient-primary {
    background: linear-gradient(90deg, var(--nordic-sage) 0%, #2a9d8f 100%) !important;
}

/* Button Groups - Nordic Style */
/* Button Groups - Nordic Pill Style */
.btn-group {
    border-radius: 50rem !important;
    /* Fully rounded pill */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: white;
    padding: 4px;
    /* Internal padding for "floating" effect */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-group .btn {
    border-radius: 50rem !important;
    margin: 0 2px;
    /* Slight spacing between buttons */
    border: none !important;
    /* Remove individual borders */
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
    color: var(--nordic-text-light);
    /* Softer default text color */
}

/* Remove default bootstrap radii overrides */
.btn-group>.btn:not(:last-child):not(.dropdown-toggle),
.btn-group>.btn:not(:first-child) {
    border-radius: 50rem !important;
}

/* Active State for Group Buttons */
.btn-group .btn.active,
.btn-group .btn:active,
.btn-group .btn:hover {
    background-color: var(--nordic-slate) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Specific overrides for outline classes within groups to match the clean style */
.btn-group .btn-outline-secondary,
.btn-group .btn-outline-primary {
    border: none;
    color: var(--nordic-text-light);
}

/* Utils */
.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Nordic Forms */
/* Checkboxes and Switches */
.form-check-input:checked {
    background-color: var(--nordic-sage);
    border-color: var(--nordic-sage);
}

.form-check-input:focus {
    border-color: var(--nordic-sage);
    box-shadow: 0 0 0 0.25rem rgba(132, 169, 140, 0.25);
}

.form-control {
    background-color: #ffffff;
    border: 1px solid var(--nordic-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--nordic-text);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--nordic-sage);
    box-shadow: 0 0 0 4px rgba(132, 169, 140, 0.1);
    color: var(--nordic-text);
}

/* Timeline Specifics */
.nordic-timeline-card {
    background: white;
    border: 1px solid var(--nordic-border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.nordic-timeline-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--nordic-sage);
}

.form-label {
    font-weight: 600;
    color: var(--nordic-slate);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Sidebar Nordic */
.nordic-sidebar {
    background-color: var(--nordic-slate) !important;
    color: white;
}

.nordic-sidebar-link {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    transition: all 0.2s ease;
}

.nordic-sidebar-link:hover,
.nordic-sidebar-link.active,
.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--nordic-sage) !important;
    font-weight: 600;
}

/* Nordic Sidebar Dropdown */
.nordic-sidebar .dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background-color: white;
    padding: 0.5rem;
    margin-bottom: 0.5rem !important;
    /* Spacing from toggle */
}

.nordic-sidebar .dropdown-item {
    border-radius: 12px;
    padding: 0.6rem 1rem;
    color: var(--nordic-slate);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nordic-sidebar .dropdown-item:hover,
.nordic-sidebar .dropdown-item:focus {
    background-color: var(--nordic-bg);
    /* Light background on hover */
    color: var(--nordic-sage);
    transform: translateX(2px);
}

.nordic-sidebar .dropdown-item.active,
.nordic-sidebar .dropdown-item:active {
    background-color: var(--nordic-sage);
    color: white;
}

.nordic-sidebar .dropdown-divider {
    border-top-color: var(--nordic-border);
    margin: 0.5rem 0;
}

/* Nordic Utilities */
.bg-nordic-sage {
    background-color: var(--nordic-sage) !important;
}

.bg-nordic-gradient {
    background: linear-gradient(90deg, var(--nordic-sage) 0%, #588157 100%) !important;
}

/* Dashboard Member Card */
.nordic-member-card {
    background: var(--nordic-surface);
    border: 1px solid var(--nordic-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nordic-member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--nordic-shadow);
    border-color: rgba(132, 169, 140, 0.3);
}

.nordic-member-card .action-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nordic-member-card:hover .action-btn {
    opacity: 1;
}

/* Layout Structure */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--nordic-bg);
}

.main-content {
    flex: 1;
    width: 100%;
    padding: 1rem;
    transition: margin-left 0.3s ease;
}

/* Utilities Overrides */
.text-primary {
    color: var(--nordic-sage) !important;
}

@media (min-width: 992px) {
    body {
        flex-direction: row;
    }

    .sidebar.offcanvas-lg {
        visibility: visible;
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex !important;
        flex-direction: column;
        z-index: 1045;
    }

    .sidebar-backdrop.show {
        display: none;
    }

    .main-content {
        width: calc(100% - 280px);
        padding: 2rem;
    }

    .mobile-header {
        display: none;
    }
}