/* Patient Interface Styles - Modern Bootstrap Compatible Design */

/* Patient-specific styles with enhanced modern design */
.patient-body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Respect document direction for layout */
[dir="rtl"] .patient-body { direction: rtl; text-align: right; }
[dir="ltr"] .patient-body { direction: ltr; text-align: left; }

/* Enhanced Patient Cards with Modern Design */
.patient-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}

.patient-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107);
    border-radius: 20px 20px 0 0;
}

.patient-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.patient-card .card-body {
    padding: 2rem;
}

/* Enhanced Patient Buttons with Modern Styling */
.btn-patient-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 15px;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: white;
}

.btn-patient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn-patient-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
}

.btn-patient-primary:hover::before {
    left: 100%;
}

.btn-patient-secondary {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid #dee2e6;
    color: #495057;
    border-radius: 15px;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.btn-patient-secondary:hover {
    background: rgba(233, 236, 239, 0.9);
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-patient-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    border-radius: 15px;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: white;
}

.btn-patient-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333, #a71e2a);
    color: white;
}

/* Enhanced Queue Status Badges */
.status-waiting {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-waiting::before {
    content: '⏳';
    font-size: 1rem;
}

.status-serving {
    background: linear-gradient(135deg, #d4edda, #a8e6a3);
    color: #155724;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
    border: 2px solid rgba(40, 167, 69, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: pulse 2s infinite;
}

.status-serving::before {
    content: '🟢';
    font-size: 1rem;
}

.status-completed {
    background: linear-gradient(135deg, #cce7ff, #a8d8f0);
    color: #004085;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
    border: 2px solid rgba(0, 123, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-completed::before {
    content: '✅';
    font-size: 1rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Patient Forms */
.patient-form-control {
    border-radius: 10px;
    border: 1px solid #ced4da;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.patient-form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

/* Input direction for phone/email */
input[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

/* Enhanced Patient Queue Position Display */
.queue-position {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 50%;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.queue-position::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Patient Stats Cards */
.patient-stats-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.patient-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

/* Enhanced Patient Navigation */
.patient-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(222, 226, 230, 0.5);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.patient-nav .navbar-brand {
    font-weight: 700;
    background: linear-gradient(135deg, #007bff, #28a745);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

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

.patient-nav .nav-link {
    color: #495057;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 6px;
    position: relative;
    overflow: hidden;
}

.patient-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.patient-nav .nav-link:hover,
.patient-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(40, 167, 69, 0.1));
    color: #007bff;
    transform: translateY(-2px);
}

.patient-nav .nav-link:hover::before,
.patient-nav .nav-link.active::before {
    width: 80%;
}

/* Favorite Heart Icon */
.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    color: #dc3545;
    transform: scale(1.1);
}

.favorite-btn.is-favorite {
    color: #dc3545;
}

/* Loading Spinner */
.patient-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects for Quick Actions */
.hover-bg-primary:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hover-bg-primary:hover .text-primary {
    color: #0d6efd !important;
}

/* Enhanced Patient Stats Cards */
.patient-stats-card.variant-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.patient-stats-card.variant-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.patient-stats-card.variant-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Enhanced Queue Position */
.queue-position.large {
    width: 100px;
    height: 100px;
    font-size: 2rem;
}

/* Enhanced Quick Actions Section */
.quick-action-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-action-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(40, 167, 69, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 123, 255, 0.3);
    box-shadow: 0 12px 30px rgba(0, 123, 255, 0.15);
    text-decoration: none !important;
}

.quick-action-item:hover::before {
    opacity: 1;
}

/* Dashboard Header Enhancement */
.dashboard-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 0 0 30px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Statistics and Info Cards */
.info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.7));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.1) 0%, transparent 70%);
    transform: translate(30px, -30px);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.1);
}

/* Loading and Transition States */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .patient-card {
        margin-bottom: 1rem;
        border-radius: 16px;
    }
    
    .patient-card .card-body {
        padding: 1.5rem;
    }
    
    .queue-position {
        width: 70px;
        height: 70px;
        font-size: 1.3rem;
    }
    
    .queue-position.large {
        width: 85px;
        height: 85px;
        font-size: 1.6rem;
    }
    
    .btn-patient-primary,
    .btn-patient-secondary,
    .btn-patient-danger {
        padding: 12px 24px;
        font-size: 0.95rem;
        border-radius: 12px;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .dashboard-header {
        border-radius: 0 0 20px 20px;
    }
    
    .patient-nav .navbar-brand {
        font-size: 1.4rem;
    }
    
    .patient-nav .nav-link {
        padding: 8px 14px;
        margin: 0 3px;
        font-size: 0.9rem;
    }
}

/* Interactive Elements and Animations */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Button position relative for ripple effect */
.btn {
    position: relative;
    overflow: hidden;
}

/* Hover text color utilities */
.hover-text-primary:hover {
    color: #007bff !important;
    transition: color 0.3s ease;
}

/* Direction-aware chevron icons */
[dir="ltr"] .fa-chevron-left { transform: scaleX(-1); }
[dir="rtl"] .fa-chevron-right { transform: scaleX(-1); }

/* Table alignment per direction */
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="ltr"] .table th, [dir="ltr"] .table td { text-align: left; }

/* Enhanced breadcrumb styling (direction-aware) */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "\f104"; /* chevron-left for RTL */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #6c757d;
}
[dir="ltr"] .breadcrumb-item + .breadcrumb-item::before {
    content: "\f105"; /* chevron-right for LTR */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #007bff;
    font-weight: 600;
}

/* Queue status updating indicator */
.queue-status-indicator.updating {
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.btn:focus,
.nav-link:focus,
.dropdown-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Enhanced alert animations */
.alert {
    animation: slideInRight 0.3s ease;
}

.alert.fade-out {
    animation: slideOutRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Improved backdrop filter support */
@supports (backdrop-filter: blur(10px)) {
    .patient-card,
    .patient-nav,
    .dashboard-header {
        backdrop-filter: blur(15px);
    }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .patient-card {
        background: rgba(255, 255, 255, 0.98);
    }
    
    .patient-nav {
        background: rgba(255, 255, 255, 0.98);
    }
    
    .dashboard-header {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* Enhanced scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .patient-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        break-inside: avoid;
    }
    
    .btn {
        border: 1px solid #000;
        background: none !important;
        color: #000 !important;
    }
    
    .badge {
        border: 1px solid #000;
    }
}
