/**
 * UI Polish & Visual Enhancements
 * Staff Rota System - December 2025
 * 
 * Enhanced colors, animations, shadows, and modern UI elements
 */

/* ==============================================
   COLOR SYSTEM - Healthcare Professional Theme
   ============================================== */

:root {
    /* Primary Brand Colors */
    --primary-blue: #0d6efd;
    --primary-blue-light: #3d8bfd;
    --primary-blue-dark: #0a58ca;
    --primary-blue-subtle: #e7f1ff;
    
    /* Secondary Colors */
    --success-green: #198754;
    --success-green-light: #20c997;
    --success-green-subtle: #d1f4e8;
    
    --warning-orange: #fd7e14;
    --warning-amber: #ffc107;
    --warning-subtle: #fff3cd;
    
    --danger-red: #dc3545;
    --danger-red-light: #ea868f;
    --danger-red-subtle: #f8d7da;
    
    --info-cyan: #0dcaf0;
    --info-cyan-subtle: #cff4fc;
    
    /* Neutral Palette */
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Semantic Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-white: #ffffff;
    
    --bg-body: #f8f9fa;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    
    --border-color: #dee2e6;
    --border-focus: #0d6efd;
    
    /* Status Colors */
    --status-active: #198754;
    --status-pending: #ffc107;
    --status-inactive: #6c757d;
    --status-critical: #dc3545;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #0cebeb 0%, #20e3b2 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Dark mode disabled for now - light mode only for demo
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #1a1a1a;
        --bg-surface: #2d2d2d;
        --bg-elevated: #3d3d3d;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --border-color: #404040;
    }
}
*/

/* ==============================================
   ENHANCED CARD STYLES
   ============================================== */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    background: var(--bg-surface);
}

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

.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Card with colored border accent */
.card-accent {
    border-left: 4px solid var(--primary-blue);
}

.card-accent.success {
    border-left-color: var(--success-green);
}

.card-accent.warning {
    border-left-color: var(--warning-orange);
}

.card-accent.danger {
    border-left-color: var(--danger-red);
}

.card-accent.info {
    border-left-color: var(--info-cyan);
}

/* Gradient card headers */
.card-header.gradient-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-header.gradient-success {
    background: var(--gradient-success);
    color: var(--text-white);
}

.card-header.gradient-warning {
    background: var(--gradient-warning);
    color: var(--text-white);
}

/* ==============================================
   ENHANCED BUTTONS
   ============================================== */

.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

/* Ripple effect on click */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

/* Gradient buttons */
.btn-gradient-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-gradient-primary:hover {
    opacity: 0.9;
    color: white;
}

.btn-gradient-success {
    background: var(--gradient-success);
    border: none;
    color: white;
}

/* Icon buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.btn-icon-lg {
    width: 56px;
    height: 56px;
    font-size: 24px;
}

/* Floating Action Button (FAB) */
.btn-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fab:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-4px) scale(1.05);
}

/* ==============================================
   BADGES & PILLS
   ============================================== */

.badge {
    border-radius: var(--radius-md);
    padding: 4px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-pill {
    border-radius: var(--radius-full);
    padding: 4px 12px;
}

/* Outlined badges */
.badge-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.badge-outline-success {
    background: transparent;
    border: 2px solid var(--success-green);
    color: var(--success-green);
}

.badge-outline-warning {
    background: transparent;
    border: 2px solid var(--warning-orange);
    color: var(--warning-orange);
}

.badge-outline-danger {
    background: transparent;
    border: 2px solid var(--danger-red);
    color: var(--danger-red);
}

/* Pulse animation for urgent badges */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.badge-pulse {
    animation: pulse 2s infinite;
}

/* ==============================================
   ALERTS & NOTIFICATIONS
   ============================================== */

.alert {
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.alert-primary {
    background: var(--primary-blue-subtle);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue-dark);
}

.alert-success {
    background: var(--success-green-subtle);
    border-left-color: var(--success-green);
    color: #0f5132;
}

.alert-warning {
    background: var(--warning-subtle);
    border-left-color: var(--warning-orange);
    color: #664d03;
}

.alert-danger {
    background: var(--danger-red-subtle);
    border-left-color: var(--danger-red);
    color: #842029;
}

.alert-info {
    background: var(--info-cyan-subtle);
    border-left-color: var(--info-cyan);
    color: #055160;
}

/* Icon in alerts */
.alert .alert-icon {
    font-size: 20px;
    margin-right: 12px;
    vertical-align: middle;
}

/* ==============================================
   LOADING STATES & SPINNERS
   ============================================== */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 0%,
        var(--gray-100) 50%,
        var(--gray-200) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.loading-overlay .spinner {
    box-shadow: var(--shadow-xl);
}

/* ==============================================
   PROGRESS BARS
   ============================================== */

.progress {
    height: 12px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--gray-200);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    transition: width 0.6s ease;
    background: var(--gradient-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.progress-bar-success {
    background: var(--gradient-success);
}

.progress-bar-warning {
    background: var(--gradient-warning);
}

/* Animated gradient progress */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.progress-bar-animated {
    background-size: 200% 200%;
    animation: gradient-shift 2s ease infinite;
}

/* ==============================================
   TABLES
   ============================================== */

.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead {
    background: var(--gray-100);
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 14px 12px;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

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

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.02);
}

/* Status indicators in tables */
.table .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.table .status-dot.active {
    background: var(--status-active);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
}

.table .status-dot.pending {
    background: var(--status-pending);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.table .status-dot.inactive {
    background: var(--status-inactive);
}

/* ==============================================
   FORMS
   ============================================== */

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Input groups with icons */
.input-icon {
    position: relative;
}

.input-icon .form-control {
    padding-left: 40px;
}

.input-icon .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ==============================================
   NAVIGATION
   ============================================== */

.navbar {
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    background: rgba(13, 110, 253, 0.95) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    transition: all var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active::after {
    width: 100%;
}

/* ==============================================
   STAT CARDS & WIDGETS
   ============================================== */

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

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

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 8px;
}

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

/* ==============================================
   TOOLTIPS & POPOVERS
   ============================================== */

.tooltip {
    z-index: var(--z-tooltip);
}

.tooltip-inner {
    background: var(--gray-900);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
}

.popover {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.popover-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* ==============================================
   MODALS
   ============================================== */

.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* ==============================================
   DROPDOWNS
   ============================================== */

.dropdown-menu {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 8px;
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.dropdown-item.active {
    background: var(--primary-blue);
}

.dropdown-divider {
    margin: 8px 0;
    border-color: var(--border-color);
}

/* ==============================================
   BREADCRUMBS
   ============================================== */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-size: 1.25rem;
    color: var(--text-muted);
}

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

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

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==============================================
   PAGINATION
   ============================================== */

.pagination {
    gap: 4px;
}

.page-link {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    margin: 0 2px;
}

.page-link:hover {
    background: var(--gray-100);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

/* ==============================================
   TRANSITIONS & ANIMATIONS
   ============================================== */

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

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

/* Slide up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s infinite;
}

/* Shake (for errors) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* ==============================================
   SCROLL BEHAVIOR
   ============================================== */

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
    border: 3px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}

/* ==============================================
   UTILITY CLASSES
   ============================================== */

/* Hover lift effect */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Glass morphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Gradient text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth shadow */
.smooth-shadow {
    box-shadow: 
        0 2.8px 2.2px rgba(0, 0, 0, 0.02),
        0 6.7px 5.3px rgba(0, 0, 0, 0.028),
        0 12.5px 10px rgba(0, 0, 0, 0.035),
        0 22.3px 17.9px rgba(0, 0, 0, 0.042),
        0 41.8px 33.4px rgba(0, 0, 0, 0.05),
        0 100px 80px rgba(0, 0, 0, 0.07);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-color);
}

/* Focus visible (accessibility) */
*:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==============================================
   PRINT STYLES
   ============================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ==============================================
   END OF UI POLISH STYLES
   ============================================== */
