/**
 * GT CLINIC PRO - Theme CSS
 * =========================
 * Custom theme with Navy Blue as primary color
 */

/* =============================================================================
   CSS Variables / Custom Properties
   ============================================================================= */

:root {
    /* Primary Colors - Navy Blue */
    --gt-primary: #1e3a5f;
    --gt-primary-light: #2c5282;
    --gt-primary-dark: #152a45;
    --gt-primary-rgb: 30, 58, 95;

    /* Secondary Colors */
    --gt-secondary: #64748b;
    --gt-secondary-light: #94a3b8;
    --gt-secondary-dark: #475569;

    /* Accent Colors */
    --gt-accent: #0ea5e9;
    --gt-accent-light: #38bdf8;
    --gt-accent-dark: #0284c7;

    /* Status Colors */
    --gt-success: #10b981;
    --gt-success-light: #34d399;
    --gt-warning: #f59e0b;
    --gt-warning-light: #fbbf24;
    --gt-danger: #ef4444;
    --gt-danger-light: #f87171;
    --gt-info: #3b82f6;
    --gt-info-light: #60a5fa;

    /* Neutral Colors */
    --gt-white: #ffffff;
    --gt-gray-50: #f8fafc;
    --gt-gray-100: #f1f5f9;
    --gt-gray-200: #e2e8f0;
    --gt-gray-300: #cbd5e1;
    --gt-gray-400: #94a3b8;
    --gt-gray-500: #64748b;
    --gt-gray-600: #475569;
    --gt-gray-700: #334155;
    --gt-gray-800: #1e293b;
    --gt-gray-900: #0f172a;
    --gt-black: #000000;

    /* Backgrounds */
    --gt-bg-body: #f1f5f9;
    --gt-bg-sidebar: #1e3a5f;
    --gt-bg-card: #ffffff;
    --gt-bg-header: #ffffff;

    /* Text Colors */
    --gt-text-primary: #1e293b;
    --gt-text-secondary: #64748b;
    --gt-text-muted: #94a3b8;
    --gt-text-light: #ffffff;

    /* Border Colors */
    --gt-border-color: #e2e8f0;
    --gt-border-light: #f1f5f9;

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

    /* Layout */
    --gt-sidebar-width: 260px;
    --gt-sidebar-collapsed-width: 70px;
    --gt-navbar-height: 60px;
    --gt-footer-height: 50px;

    /* Transitions */
    --gt-transition-fast: 150ms ease;
    --gt-transition-normal: 300ms ease;
    --gt-transition-slow: 500ms ease;

    /* Border Radius */
    --gt-radius-sm: 0.25rem;
    --gt-radius: 0.375rem;
    --gt-radius-md: 0.5rem;
    --gt-radius-lg: 0.75rem;
    --gt-radius-xl: 1rem;
    --gt-radius-full: 9999px;
}

/* =============================================================================
   Bootstrap Overrides
   ============================================================================= */

/* Primary Color Override */
.btn-primary {
    --bs-btn-bg: var(--gt-primary);
    --bs-btn-border-color: var(--gt-primary);
    --bs-btn-hover-bg: var(--gt-primary-dark);
    --bs-btn-hover-border-color: var(--gt-primary-dark);
    --bs-btn-active-bg: var(--gt-primary-dark);
    --bs-btn-active-border-color: var(--gt-primary-dark);
    --bs-btn-disabled-bg: var(--gt-primary);
    --bs-btn-disabled-border-color: var(--gt-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--gt-primary);
    --bs-btn-border-color: var(--gt-primary);
    --bs-btn-hover-bg: var(--gt-primary);
    --bs-btn-hover-border-color: var(--gt-primary);
    --bs-btn-active-bg: var(--gt-primary);
    --bs-btn-active-border-color: var(--gt-primary);
}

.bg-primary {
    background-color: var(--gt-primary) !important;
}

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

.border-primary {
    border-color: var(--gt-primary) !important;
}

/* Link Colors */
a {
    color: var(--gt-primary);
}

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

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--gt-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(var(--gt-primary-rgb), 0.15);
}

/* =============================================================================
   Base Styles
   ============================================================================= */

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gt-bg-body);
    color: var(--gt-text-primary);
    line-height: 1.6;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gt-text-primary);
    margin-bottom: 0.5rem;
}

/* =============================================================================
   App Layout
   ============================================================================= */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--gt-sidebar-width);
    transition: margin-left var(--gt-transition-normal);
}

.app-content {
    flex: 1;
    min-height: calc(100vh - var(--gt-navbar-height) - var(--gt-footer-height));
}

/* =============================================================================
   Sidebar
   ============================================================================= */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--gt-sidebar-width);
    background: linear-gradient(180deg, var(--gt-primary) 0%, var(--gt-primary-dark) 100%);
    color: var(--gt-text-light);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--gt-transition-normal), width var(--gt-transition-normal);
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: var(--gt-navbar-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--gt-text-light);
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--gt-text-light);
    padding: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
}

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

/* Scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Sidebar Navigation */
.sidebar-nav .nav-item {
    margin: 0.125rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--gt-radius);
    transition: all var(--gt-transition-fast);
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gt-text-light);
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--gt-text-light);
}

/* Submenu */
.sidebar-nav .has-submenu .submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform var(--gt-transition-fast);
}

.sidebar-nav .has-submenu .nav-link[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-nav .submenu {
    padding-left: 1rem;
}

.sidebar-nav .submenu .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Sidebar Section */
.sidebar-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section-title {
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--gt-radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    overflow: hidden;
}

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

.sidebar-user-avatar .avatar-initials {
    font-size: 0.875rem;
    font-weight: 600;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: all var(--gt-transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =============================================================================
   Navbar
   ============================================================================= */

.app-navbar {
    background: var(--gt-bg-header);
    border-bottom: 1px solid var(--gt-border-color);
    min-height: var(--gt-navbar-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--gt-shadow-sm);
}

.app-navbar .navbar {
    min-height: var(--gt-navbar-height);
    padding: 0 1rem;
}

.app-navbar .navbar-toggler {
    border: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--gt-text-secondary);
}

.app-navbar .navbar-toggler:focus {
    box-shadow: none;
}

/* Navbar Search */
.navbar-search {
    max-width: 400px;
    flex: 1;
    margin: 0 1rem;
}

.navbar-search .input-group {
    background: var(--gt-gray-100);
    border-radius: var(--gt-radius-full);
    overflow: hidden;
}

.navbar-search .form-control {
    background: transparent;
    padding: 0.5rem 0;
}

.navbar-search .form-control:focus {
    background: transparent;
    box-shadow: none;
}

.navbar-search .input-group-text {
    padding-left: 1rem;
    color: var(--gt-text-muted);
}

/* Navbar Nav */
.app-navbar .navbar-nav {
    align-items: center;
}

.app-navbar .nav-item {
    margin-left: 0.25rem;
}

.app-navbar .nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--gt-text-secondary);
    border-radius: var(--gt-radius);
    display: flex;
    align-items: center;
}

.app-navbar .nav-link:hover {
    background: var(--gt-gray-100);
    color: var(--gt-text-primary);
}

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

/* Navbar Avatar */
.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--gt-radius-full);
    background: var(--gt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.navbar-avatar .avatar-initials {
    color: var(--gt-text-light);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    min-width: 18px;
    height: 18px;
    padding: 0 0.375rem;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--gt-danger);
    color: var(--gt-text-light);
    border-radius: var(--gt-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification Dropdown */
.notification-dropdown {
    width: 360px;
    max-height: 480px;
    overflow: hidden;
    padding: 0;
}

.notification-header {
    background: var(--gt-gray-50);
    border-bottom: 1px solid var(--gt-border-color);
}

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

/* =============================================================================
   Footer
   ============================================================================= */

.app-footer {
    background: var(--gt-bg-header);
    border-top: 1px solid var(--gt-border-color);
    min-height: var(--gt-footer-height);
    display: flex;
    align-items: center;
}

/* =============================================================================
   Cards
   ============================================================================= */

.card {
    border: none;
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    background: var(--gt-bg-card);
}

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

.card-title {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.1;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--gt-text-secondary);
    font-size: 0.875rem;
}

/* =============================================================================
   Tables
   ============================================================================= */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gt-gray-50);
    border-bottom: 2px solid var(--gt-border-color);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gt-text-secondary);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gt-border-light);
}

.table tbody tr:hover {
    background: var(--gt-gray-50);
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--gt-radius);
    transition: all var(--gt-transition-fast);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* =============================================================================
   Forms
   ============================================================================= */

.form-label {
    font-weight: 500;
    color: var(--gt-text-primary);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    border-radius: var(--gt-radius);
    border-color: var(--gt-border-color);
    padding: 0.5rem 0.875rem;
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--gt-gray-100);
}

.form-text {
    color: var(--gt-text-muted);
    font-size: 0.8125rem;
}

/* =============================================================================
   Badges
   ============================================================================= */

.badge {
    font-weight: 500;
    padding: 0.375em 0.625em;
    border-radius: var(--gt-radius);
}

.badge-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: var(--gt-radius-full);
    display: inline-block;
}

/* =============================================================================
   Auth Layout
   ============================================================================= */

.auth-layout {
    background: var(--gt-bg-body);
    min-height: 100vh;
}

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

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

.auth-branding {
    width: 45%;
    background: linear-gradient(135deg, var(--gt-primary) 0%, var(--gt-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-branding-content {
    max-width: 400px;
    color: var(--gt-text-light);
}

.auth-tagline {
    font-size: 1.25rem;
    opacity: 0.9;
}

.auth-features {
    margin-top: 2rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.auth-feature i {
    font-size: 1.5rem;
    margin-right: 1rem;
    width: 32px;
    text-align: center;
}

.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gt-white);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
}

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

@media (max-width: 991.98px) {
    .app-main {
        margin-left: 0;
    }

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

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

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .auth-branding {
        display: none;
    }

    .auth-form-container {
        padding: 1rem;
    }

    .notification-dropdown {
        width: 100%;
        max-width: 360px;
    }
}

/* =============================================================================
   RTL Support
   ============================================================================= */

[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .app-main {
    margin-left: 0;
    margin-right: var(--gt-sidebar-width);
}

[dir="rtl"] .sidebar-nav .nav-link i {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .sidebar-nav .has-submenu .submenu-arrow {
    margin-left: 0;
    margin-right: auto;
}

@media (max-width: 991.98px) {
    [dir="rtl"] .app-main {
        margin-right: 0;
    }

    [dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .app-sidebar.active {
        transform: translateX(0);
    }
}

/* =============================================================================
   Utilities
   ============================================================================= */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all var(--gt-transition-normal);
}
