/* Free a Girl - Dark Theme CSS
 * Aesthetic black UX with NGO vibes for survivor case management system
 * Created for Free a Girl
 */

/**
 * Global styles for Survivor Case Management System
 * Using Inter font family for all elements
 */

:root {
    /* Color palette */
    --primary: #1287fd;       /* Platform accent blue */
    --primary-rgb: 18, 135, 253; /* RGB values of primary color for opacity */
    --primary-light: #bb45c3; /* Lighter purple (unused here but kept for compatibility) */
    --primary-dark: #117ae4;  /* Darker accent blue */
    --accent: #ff4081;        /* Pink accent */
    --danger: #ff5252;        /* Red */
    --success: #43a047;       /* Green */
    --warning: #ffb300;       /* Amber */
    --info: #039be5;          /* Light Blue */
    
    /* Dark theme colors */
    --black: #000000;         /* Pure black */
    --bg-dark: #17191c;       /* Main background */
    --bg-darker: #212328;     /* Darker background */
    --bg-card: #272729;       /* Card background */
    --bg-input: #28282a;      /* Input background */
    
    /* Text colors */
    --text-primary: #ffffffe6;/* Main text */
    --text-white: #ffffff;    /* Pure white */
    --text-secondary: #fff9;  /* Secondary text */
    --text-muted: #999999;    /* Muted text */
    --text-link: #1287fd;     /* Link color */
    
    /* Border and shadow */
    --border-color: #ffffff1a;/* Border with transparency */
    --shadow-color: rgba(0,0,0,0.5); /* Shadow */
    
    /* Layout */
    --header-height: 60px;
    --sidebar-width: 250px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Font weights */
    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-bold: 700;
}

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

html, body {
    height: 100%;
    font-family: "Inter", sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-light);
}

h2 { font-size: 1.8rem; }
h5 { font-size: 1.1rem; font-weight: var(--font-medium); }
h6 { font-size: 1rem; }

p { margin-bottom: var(--spacing-md); }

a {
    color: var(--text-link);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Layout */
.page-wrapper {
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-left: var(--sidebar-width);
}

.main-content {
    height: auto;
    width: auto;
    padding: 0;
    margin: 0;
    max-width: none;
    overflow: visible;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: 10px;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}


.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 16px;
}

/* Survivor-specific card styles */
.card-header-survivor {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    position: relative;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
}

.card-header-survivor::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary);
    border-radius: 10px 0 0 0;
}

.card-header-survivor .card-title {
    font-weight: var(--font-semibold);
    color: var(--text-white);
    margin-bottom: 0;
    padding-left: 8px;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.card-body-survivor {
    padding: 24px;
    background-color: var(--bg-card);
    border-radius: 0 0 10px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Survivor page specific grid improvements */
.survivor-page .card {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.survivor-page .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.survivor-page .info-item {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
}

.survivor-page .info-item:last-child {
    margin-bottom: 0;
}

.survivor-page .info-label {
    min-width: 140px;
    color: var(--text-muted);
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.survivor-page .info-label i {
    font-size: 16px;
    margin-right: 8px;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.survivor-page .info-value {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

/* Timeline improvements */
.timeline {
    position: relative;
    padding-left: 28px;
    margin-top: 8px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    width: 2px;
    background: rgba(var(--primary-rgb), 0.2);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -28px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timeline-content {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-left: 8px;
}

.timeline-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-white);
    font-weight: var(--font-medium);
}

.timeline-date {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: var(--font-medium);
}

.timeline-description {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Rescue Reports table styles */
.survivor-page .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.survivor-page .table th {
    background-color: transparent;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-weight: var(--font-medium);
    padding: 12px 16px;
}

.survivor-page .table td {
    padding: 14px 16px;
    vertical-align: middle;
    background-color: rgba(255, 255, 255, 0.02);
    border: none;
}

.survivor-page .table tr {
    transition: all 0.2s ease;
}

.survivor-page .table tr:hover td {
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* Notes list styling */
.notes-list {
    max-height: 500px;
    overflow-y: auto;
    margin-right: -8px;
    padding-right: 8px;
}

.notes-list::-webkit-scrollbar {
    width: 6px;
}

.notes-list::-webkit-scrollbar-thumb {
    background-color: rgba(var(--primary-rgb), 0.3);
    border-radius: 3px;
}

.note-item {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
}

.note-item.system-note {
    border-left-color: var(--info);
    background-color: rgba(3, 155, 229, 0.05);
}

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

.note-user {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

.note-user i {
    margin-right: 8px;
    color: var(--primary);
}

.system-note .note-user i {
    color: var(--info);
}

.note-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-content {
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}

/* Form improvements for survivor page */
.survivor-page .form-group {
    margin-bottom: 20px;
}

.survivor-page .form-control {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 6px;
}

.survivor-page .form-control:focus {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.survivor-page .custom-file-label {
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
}

.survivor-page .custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Map container styling */
#map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    background: transparent;
    font-size: 0.9rem;
    font-weight: var(--font-medium);
    transition: all 0.3s ease;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-outline-secondary {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-darker);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Dashboard Components */
.welcome-header-card {
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.welcome-header-card .card-body {
    padding: 1.5rem;
}

.welcome-header-card h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.welcome-header-card .text-muted {
    color: var(--text-secondary) !important;
    font-size: 13px;
}

.stat-card .icon-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.bg-light-primary { background-color: rgba(18, 135, 253, 0.1); }
.bg-light-success { background-color: rgba(67, 160, 71, 0.1); }
.bg-light-info { background-color: rgba(3, 155, 229, 0.1); }
.bg-light-warning { background-color: rgba(255, 179, 0, 0.1); }

.activity-feed, .upcoming-actions {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.activity-feed::-webkit-scrollbar, .upcoming-actions::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-thumb, .upcoming-actions::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.activity-item { border-bottom: 1px solid var(--border-color); }

.case-card .progress {
    height: 4px;
    background-color: var(--bg-darker);
}

.progress-circle {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    background: var(--bg-darker);
}

.progress-circle::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    background: var(--bg-dark);
    border-radius: 50%;
}

.progress-circle-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.quick-action-card {
    background-color: var(--bg-card);
    transition: transform 0.2s ease;
}

.quick-action-card:hover {
    transform: translateY(-2px);
}

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-info { color: var(--info) !important; }
.text-warning { color: var(--warning) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-secondary { background-color: var(--text-muted) !important; }

.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-0 { margin-bottom: 0; }
.p-0 { padding: 0; }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: 0.5rem; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.h-100 { height: 100%; }

.fw-medium { font-weight: var(--font-medium); }
.fw-bold { font-weight: var(--font-bold); }
.fs-3 { font-size: 1.5rem; }
.fs-4 { font-size: 1.25rem; }

.rounded { border-radius: 8px; }
.rounded-circle { border-radius: 50%; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-xl-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
.col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 0 15px; }

@media (max-width: 992px) {
    .col-md-3 { flex: 0 0 50%; max-width: 50%; }
    .col-md-6 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 767px) {
    .col-md-3 { flex: 0 0 100%; max-width: 100%; }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* ===== Header ===== */
.header {
    align-items: center;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    height: var(--header-height);
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    padding-right: var(--spacing-md);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    height: 36px;
    margin-right: 0;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-title-container {
    margin-left: var(--spacing-md);
}

.header-title {
    color: var(--platform-text-active);
    font-size: 1.2rem;
    font-weight: var(--font-medium);
    letter-spacing: 0.03em;
    margin: 0;
    transition: color 0.3s ease;
}

.header-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.session-info {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    background-color: rgba(255, 255, 255, 0.07);
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    color: var(--text-muted);
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-timer i {
    font-size: 0.8rem;
    color: var(--primary);
}

.header-nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.header-nav .nav-link {
    align-items: center;
    border-radius: 4px;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.9rem;
    padding: var(--spacing-sm);
    position: relative;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.header-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--platform-text-active);
}

.nav-notification {
    position: relative;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

.header-nav .nav-link i {
    font-size: 1.1rem;
    margin-right: 6px;
}

.header-nav .nav-link:last-child i {
    margin-right: 0;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
    margin-left: var(--spacing-sm);
}

.user-menu-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-name {
    font-size: 0.9rem;
    font-weight: var(--font-medium);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

.dropdown-icon {
    font-size: 0.8rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--bg-darker);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 250px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.user-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: var(--text-secondary);
}

.user-info {
    flex: 1;
}

.user-info .user-name {
    font-weight: var(--font-medium);
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.user-info .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-dropdown-body {
    padding: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item i {
    margin-right: 0.75rem;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

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

.text-danger {
    color: var(--danger) !important;
}

/* Theme Toggle Switch */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-right: var(--spacing-sm);
}

.theme-toggle {
    cursor: pointer;
    display: inline-block;
    height: 24px;
    position: relative;
    width: 24px;
}

.theme-toggle-input {
    height: 0;
    opacity: 0;
    width: 0;
}

.theme-toggle-label {
    background-color: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    height: 24px;
    justify-content: center;
    transition: all 0.3s ease;
    width: 24px;
}

/* Show sun icon in light mode */
.theme-toggle-label::before {
    color: var(--text-secondary);
    content: "\f185"; /* fa-sun code */
    font-family: "Font Awesome 6 Free";
    font-size: 1.1rem;
    font-weight: 900;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    line-height: 1;
}

/* Show moon icon in dark mode */
.theme-toggle-label::after {
    color: var(--text-secondary);
    content: "\f186"; /* fa-moon code */
    font-family: "Font Awesome 6 Free";
    font-size: 1.1rem;
    font-weight: 900;
    opacity: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    line-height: 1;
}

/* When checked (light mode), hide moon and show sun */
.theme-toggle-input:checked + .theme-toggle-label::before {
    opacity: 1;
}

.theme-toggle-input:checked + .theme-toggle-label::after {
    opacity: 0;
}

/* Add subtle hover effect */
.theme-toggle-label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.light-theme .theme-toggle-label:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ===== Badge for notifications ===== */
.badgenotification {
    align-items: center;
    border-radius: 50%;
    color: white;
    display: flex;
    font-size: 0.65rem;
    font-weight: 600;
    height: 16px;
    justify-content: center;
    line-height: 1;
    min-width: 16px;
    padding: 0 4px;
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(25%, -25%);
}

.badgenotification-primary {
    background-color: var(--platform-bg-accent);
}

/* ===== Sidebar ===== */
.sidebar {
    background-color: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    left: 0;
    overflow-y: auto;
    padding: var(--spacing-md);
    position: fixed;
    top: var(--header-height);
    width: var(--sidebar-width);
    z-index: 90;
}

.sidebar-nav {
    padding-top: var(--spacing-md);
}

.nav-group {
    margin-bottom: var(--spacing-lg);
}

.nav-group-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: var(--font-medium);
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
    text-transform: uppercase;
}

.nav-item {
    align-items: center;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
    padding: var(--spacing-sm);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--platform-text-active);
}

.nav-item.active {
    background-color: var(--platform-bg-accent);
    color: var(--platform-text-active);
}

.nav-item i {
    margin-right: var(--spacing-sm);
    width: 20px;
    text-align: center;
    font-size: 1rem;
}


/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 8px 12px;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    border-color: var(--focus-border);
    box-shadow: 0 0 0 2px rgba(10, 170, 255, 0.2);
    outline: none;
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
}

::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23707070' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ===== Buttons ===== */
.btn {
    align-items: center;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--spacing-xs);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 500;
    justify-content: center;
    padding: 8px 16px;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
}

.btn-primary {
    background-color: var(--platform-bg-accent);
    border-color: var(--platform-bg-accent);
    color: var(--platform-text-active);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--platform-bg-accent-hover);
    border-color: var(--platform-bg-accent-hover);
}

.btn-secondary {
    color: var(--text-primary);
    background-color: var(--bg-input);
    border-color: var(--border-color);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #3a3a3a;
}

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

.btn-accent:hover, .btn-accent:focus {
    background-color: #e91e63;
    border-color: #e91e63;
}

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

.btn-danger:hover, .btn-danger:focus {
    background-color: #c62828;
    border-color: #c62828;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--spacing-sm);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    font-size: 1.2rem;
}

/* ===== Alerts ===== */
.alert {
    border-left: 4px solid transparent;
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
    padding: 12px 16px;
}

.alert-success {
    background-color: rgba(67, 160, 71, 0.1);
    border-left-color: var(--success);
}

.alert-danger {
    background-color: rgba(255, 82, 82, 0.1);
    border-left-color: var(--platform-text-warning);
}

.alert-warning {
    background-color: rgba(255, 179, 0, 0.1);
    border-left-color: var(--warning);
}

.alert-info {
    background-color: rgba(3, 155, 229, 0.1);
    border-left-color: var(--platform-bg-accent);
}

/* ===== Tables ===== */
.table-responsive {
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

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

.table th {
    background-color: var(--bg-darker);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(255,255,255,0.03);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.01);
}

/* ===== Dashboard Components ===== */

.trend-indicator {
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
}

.trend-indicator.positive {
    color: var(--success);
}

.trend-indicator.negative {
    color: var(--platform-text-warning);
}

.trend-period {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    padding: 12px 16px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--platform-text-active);
    display: flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    margin-right: 12px;
    width: 36px;
}

.activity-aftercare { background-color: rgba(255, 64, 129, 0.2); }
.activity-justice { background-color: rgba(255, 179, 0, 0.2); }
.activity-reintegration { background-color: rgba(67, 160, 71, 0.2); }
.activity-general { background-color: rgba(18, 135, 253, 0.2); }

.activity-content {
    flex: 1;
}

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

.activity-title {
    color: var(--platform-text-active);
    font-size: 0.85rem;
    font-weight: 500;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.activity-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.activity-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Upcoming Actions */
.upcoming-actions {
    max-height: 350px;
    overflow-y: auto;
}

.action-item {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    padding: 12px 6px;
}

.action-item:last-child {
    border-bottom: none;
}

.action-date {
    align-items: center;
    background-color: var(--bg-darker);
    border-radius: 4px;
    color: var(--platform-text-active);
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 500;
    height: 50px;
    justify-content: center;
    margin-right: 12px;
    text-align: center;
    width: 50px;
}

.action-content {
    flex: 1;
}

.action-title {
    align-items: center;
    display: flex;
    margin-bottom: 3px;
}

.action-survivor {
    color: var(--platform-text-active);
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 5px;
}

.action-details {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.action-controls {
    flex-shrink: 0;
}

/* Empty States */
.empty-state {
    color: var(--text-muted);
    padding: 2rem 1rem;
    text-align: center;
}

.empty-state i {
    margin-bottom: 1rem;
}

/* Case link styling */
.case-link {
    color: var(--platform-bg-accent);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.case-link:hover {
    color: var(--platform-bg-accent-hover);
}

/* Card enhancements */
.card-actions {
    display: flex;
    gap: 8px;
}

/* Welcome section */
.welcome-section h1 {
    color: var(--platform-text-active);
    margin-bottom: 8px;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 8px;
}

/* Responsive adjustments for dashboard */
@media (max-width: 992px) {
    .stat-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .quick-actions {
        justify-content: flex-start;
        margin-top: 15px;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }
.bg-info { background-color: var(--info); }

.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }
.m-0 { margin: 0; }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-3 { flex: 0 0 25%; max-width: 25%; padding-right: 15px; padding-left: 15px; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding-right: 15px; padding-left: 15px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding-right: 15px; padding-left: 15px; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; padding-right: 15px; padding-left: 15px; }
.col-9 { flex: 0 0 75%; max-width: 75%; padding-right: 15px; padding-left: 15px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding-right: 15px; padding-left: 15px; }


/* ===== Media Queries ===== */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 60px;
    }
    
    .sidebar {
        overflow: visible;
    }
    
    .sidebar .nav-group-title,
    .sidebar .nav-item span {
        display: none;
    }
    
    .sidebar .nav-item {
        text-align: center;
        padding: var(--spacing-sm);
    }
    
    .sidebar .nav-item i {
        margin-right: 0;
        font-size: 1.2rem;
    }
    
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 768px) {
    :root {
        --header-height: 50px;
        --sidebar-width: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    
    .search-input {
        padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-xl);
    }
}

/* Typography utility classes */
.font-thin { font-weight: var(--font-thin); }
.font-extra-light { font-weight: var(--font-extra-light); }
.font-light { font-weight: var(--font-light); }
.font-regular { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semi-bold { font-weight: var(--font-semi-bold); }
.font-bold { font-weight: var(--font-bold); }
.font-extra-bold { font-weight: var(--font-extra-bold); }
.font-black { font-weight: var(--font-black); }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-light);
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

/* Forms */
input, select, textarea, button {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* Links */
a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--black);
    border: 0.5px solid var(--border-grey);
    border-radius: 4px;
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    border-color: var(--text-light);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5, h6 { font-size: 1rem; }
}

/* 
 * Content Area Freedom
 * These styles ensure the main content area has minimal styling restrictions
 * to allow for complete page customization
 */
.main-content {
    height: auto;
    width: auto;
    padding: 0;
    margin: 0;
    max-width: none;
    overflow: visible;
}

/* When you want to use the default container layout */
.use-default-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
