/* ==========================================================================
   E-Santé Guinée - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (Theme Colors)
   -------------------------------------------------------------------------- */
:root {
    /* Primary Colors */
    --primary: #0F8A68;
    --primary-dark: #0a6b51;
    --primary-light: #12a87e;
    --primary-soft: rgba(15, 138, 104, 0.1);

    /* Secondary Colors */
    --secondary: #3B82F6;
    --secondary-dark: #2563eb;
    --secondary-soft: rgba(59, 130, 246, 0.1);

    /* Status Colors */
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --info: #3B82F6;
    --info-soft: rgba(59, 130, 246, 0.1);
    --purple: #8B5CF6;
    --purple-soft: rgba(139, 92, 246, 0.1);

    /* Neutrals */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;

    /* Header */
    --header-height: 70px;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: var(--font-family);
    font-size: 0.9375rem;
    color: var(--gray-700);
    background-color: var(--gray-50);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* --------------------------------------------------------------------------
   Public Navbar & Spacer
   -------------------------------------------------------------------------- */
.public-page .navbar.fixed-top {
    background: white !important;
    transition: box-shadow 0.3s ease;
}

.public-page .navbar.fixed-top.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.public-page .navbar .nav-link {
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.public-page .navbar .nav-link:hover,
.public-page .navbar .nav-link.active {
    color: var(--primary);
}

.navbar-spacer {
    height: 72px;
}

@media (max-width: 991.98px) {
    .navbar-spacer {
        height: 62px;
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--gray-300);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
}

/* --------------------------------------------------------------------------
   Auth Pages
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    background: var(--gray-50);
}

.auth-container {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.auth-left-content {
    max-width: 500px;
    color: white;
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.auth-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.7;
}

.auth-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.auth-feature i {
    font-size: 1.25rem;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.auth-form-subtitle {
    margin-top: 0.5rem;
    color: var(--gray-600);
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-500);
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-language-selector a {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.auth-language-selector a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Auth Form Styling */
.auth-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: var(--gray-700);
}

.auth-form .form-control {
    background-color: white;
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
}

.auth-form .form-control::placeholder {
    color: var(--gray-400);
}

.auth-form .form-control:focus {
    background-color: white;
    color: var(--gray-800);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.auth-form .form-label {
    color: var(--gray-700);
    font-weight: 500;
}

.auth-form .form-check-label {
    color: var(--gray-600);
}

.auth-form .input-group-text {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.auth-form p,
.auth-form span {
    color: var(--gray-600);
}

.auth-form .text-muted {
    color: var(--gray-500) !important;
}

.auth-form .text-primary {
    color: var(--primary) !important;
}

.auth-form .invalid-feedback {
    color: var(--danger);
}

.auth-form a {
    color: var(--primary);
}

.auth-form a:hover {
    color: var(--primary-dark);
}

.auth-form .btn-outline-secondary {
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.auth-form .btn-outline-secondary:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

.auth-form .small,
.auth-form small {
    color: var(--gray-600);
}

.auth-form h2,
.auth-form h3,
.auth-form h4 {
    color: var(--gray-800);
}

.auth-right {
    background-color: var(--gray-50);
}

/* --------------------------------------------------------------------------
   Dashboard Layout
   -------------------------------------------------------------------------- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo img {
    height: 35px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-soft);
}

.sidebar-nav .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-soft);
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

.sidebar-nav .nav-divider {
    height: 0;
    margin: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    list-style: none;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    list-style: none;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-logout {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-500);
    transition: all 0.2s;
}

.sidebar-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search {
    position: relative;
}

.header-search .form-control {
    padding-left: 2.5rem;
    width: 250px;
    background: var(--gray-50);
    border-color: transparent;
}

.header-search .form-control:focus {
    background: white;
    border-color: var(--primary);
}

.header-search i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--gray-700);
}

.btn-user:hover {
    background: var(--gray-100);
    border-radius: var(--radius);
}

.user-avatar,
.user-avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.main-body {
    flex: 1;
    padding: 1.5rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.page-subtitle {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.main-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: white;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* --------------------------------------------------------------------------
   Home Page
   -------------------------------------------------------------------------- */
.home-page {
    background: white;
}

.hero-section {
    padding-top: 80px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-top: 1.5rem;
    max-width: 500px;
}

.hero-buttons {
    margin-top: 2rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.hero-stats .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.hero-stats .stat-label {
    color: var(--gray-600);
}

.hero-image {
    max-width: 100%;
    height: auto;
}

/* Services Section */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
}

.section-subtitle {
    font-size: 1.125rem;
}

.service-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.service-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--gray-600);
    margin-bottom: 0;
}

/* Background Colors */
.bg-primary-soft { background-color: var(--primary-soft) !important; color: var(--primary) !important; }
.bg-success-soft { background-color: var(--success-soft) !important; color: var(--success) !important; }
.bg-danger-soft { background-color: var(--danger-soft) !important; color: var(--danger) !important; }
.bg-warning-soft { background-color: var(--warning-soft) !important; color: var(--warning) !important; }
.bg-info-soft { background-color: var(--info-soft) !important; color: var(--info) !important; }
.bg-purple-soft { background-color: var(--purple-soft) !important; color: var(--purple) !important; }

/* How It Works */
.step-card {
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.step-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.step-card p {
    color: var(--gray-600);
    margin-bottom: 0;
}

/* CTA Section */
.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Footer */
.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* --------------------------------------------------------------------------
   Quick Action Cards
   -------------------------------------------------------------------------- */
.quick-action-card {
    text-decoration: none;
    transition: all 0.2s;
}

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

.quick-action-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Profile Page
   -------------------------------------------------------------------------- */
.profile-card .profile-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
}

.profile-card .profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary);
}

.btn-avatar-edit {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-name {
    font-weight: 600;
    color: var(--gray-800);
}

.profile-role {
    font-size: 0.875rem;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state i {
    color: var(--gray-300);
}

.empty-state h6 {
    color: var(--gray-600);
}

/* --------------------------------------------------------------------------
   Notifications Dropdown
   -------------------------------------------------------------------------- */
.notification-dropdown {
    width: 360px;
    padding: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.notification-header h6 {
    margin: 0;
    font-weight: 600;
}

.notification-header a {
    font-size: 0.75rem;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: var(--gray-50);
}

.notification-item.unread {
    background-color: var(--primary-soft);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.notification-footer a {
    font-size: 0.875rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Welcome Card
   -------------------------------------------------------------------------- */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stats .stat-number {
        font-size: 1.5rem;
    }

    .auth-left {
        display: none !important;
    }
}
