/**
 * GT CLINIC PRO - Custom CSS
 * ==========================
 * Additional custom styles and component overrides
 */

/* =============================================================================
   Page Headers
   ============================================================================= */

.page-header {
    background: var(--gt-bg-card);
    border-bottom: 1px solid var(--gt-border-color);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--gt-text-primary);
}

.page-subtitle {
    color: var(--gt-text-secondary);
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* =============================================================================
   Breadcrumb
   ============================================================================= */

.breadcrumb-wrapper {
    background: var(--gt-gray-50);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--gt-border-light);
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--gt-text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--gt-primary);
}

.breadcrumb-item.active {
    color: var(--gt-text-primary);
}

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

.datatable-wrapper {
    background: var(--gt-bg-card);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    overflow: hidden;
}

.datatable-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gt-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.datatable-search {
    max-width: 300px;
}

.datatable-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.datatable-body {
    overflow-x: auto;
}

.datatable-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gt-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.datatable-info {
    color: var(--gt-text-secondary);
    font-size: 0.875rem;
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--gt-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--gt-success);
}
.status-badge.status-success::before {
    background: var(--gt-success);
}

.status-badge.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gt-warning);
}
.status-badge.status-warning::before {
    background: var(--gt-warning);
}

.status-badge.status-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--gt-danger);
}
.status-badge.status-danger::before {
    background: var(--gt-danger);
}

.status-badge.status-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--gt-info);
}
.status-badge.status-info::before {
    background: var(--gt-info);
}

.status-badge.status-secondary {
    background: var(--gt-gray-100);
    color: var(--gt-text-secondary);
}
.status-badge.status-secondary::before {
    background: var(--gt-secondary);
}

/* =============================================================================
   Avatar
   ============================================================================= */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gt-radius-full);
    background: var(--gt-primary);
    color: var(--gt-text-light);
    font-weight: 600;
    overflow: hidden;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 0.625rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.125rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

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

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--gt-white);
    margin-left: -0.5rem;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* =============================================================================
   Empty States
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gt-gray-300);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gt-text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--gt-text-secondary);
    margin-bottom: 1.5rem;
}

/* =============================================================================
   Loading States
   ============================================================================= */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gt-gray-200);
    border-top-color: var(--gt-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   Patient Card
   ============================================================================= */

.patient-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.patient-card .avatar {
    flex-shrink: 0;
}

.patient-info {
    min-width: 0;
}

.patient-name {
    font-weight: 500;
    color: var(--gt-text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-meta {
    font-size: 0.8125rem;
    color: var(--gt-text-secondary);
}

/* =============================================================================
   Action Dropdown
   ============================================================================= */

.action-dropdown .dropdown-toggle {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--gt-text-secondary);
}

.action-dropdown .dropdown-toggle:hover {
    color: var(--gt-text-primary);
    background: var(--gt-gray-100);
}

.action-dropdown .dropdown-toggle::after {
    display: none;
}

.action-dropdown .dropdown-menu {
    min-width: 160px;
    padding: 0.5rem 0;
    box-shadow: var(--gt-shadow-lg);
    border: 1px solid var(--gt-border-color);
}

.action-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-dropdown .dropdown-item i {
    width: 1rem;
    text-align: center;
    color: var(--gt-text-secondary);
}

.action-dropdown .dropdown-item:hover i {
    color: inherit;
}

/* =============================================================================
   Timeline
   ============================================================================= */

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gt-border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

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

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gt-primary);
    border: 2px solid var(--gt-white);
    box-shadow: 0 0 0 2px var(--gt-primary);
}

.timeline-content {
    background: var(--gt-gray-50);
    border-radius: var(--gt-radius);
    padding: 0.75rem 1rem;
}

.timeline-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

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

/* =============================================================================
   Quick Stats
   ============================================================================= */

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-stat {
    background: var(--gt-bg-card);
    border-radius: var(--gt-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--gt-shadow);
}

.quick-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gt-text-primary);
    line-height: 1.2;
}

.quick-stat-label {
    font-size: 0.875rem;
    color: var(--gt-text-secondary);
    margin-top: 0.25rem;
}

.quick-stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.quick-stat-change.positive {
    color: var(--gt-success);
}

.quick-stat-change.negative {
    color: var(--gt-danger);
}

/* =============================================================================
   Calendar
   ============================================================================= */

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

.calendar-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gt-text-secondary);
    border-bottom: 1px solid var(--gt-border-color);
}

.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    border-right: 1px solid var(--gt-border-light);
    border-bottom: 1px solid var(--gt-border-light);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background: var(--gt-gray-50);
}

.calendar-day.today {
    background: rgba(var(--gt-primary-rgb), 0.05);
}

.calendar-date {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.calendar-day.today .calendar-date {
    background: var(--gt-primary);
    color: var(--gt-text-light);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--gt-radius-sm);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.event-primary {
    background: rgba(var(--gt-primary-rgb), 0.15);
    color: var(--gt-primary);
}

.calendar-event.event-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--gt-success);
}

.calendar-event.event-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gt-warning);
}

.calendar-event.event-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--gt-danger);
}

/* =============================================================================
   Form Sections
   ============================================================================= */

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gt-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gt-border-color);
}

.form-section-subtitle {
    font-size: 0.875rem;
    color: var(--gt-text-secondary);
    margin-top: -0.75rem;
    margin-bottom: 1rem;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .app-sidebar,
    .app-navbar,
    .app-footer,
    .page-actions,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }
}
