/* AMU Clinic - Modern Clinical Design System */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth Transitions - Applied to interactive elements only for performance */
a, button, input, .btn, .role-card, .list-group-item, .panel {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Bootstrap 4 gap utility fix */
.d-flex.gap-3 {
    gap: 1rem;
}
.d-flex.gap-3 > * {
    margin-right: 1rem;
}
.d-flex.gap-3 > *:last-child {
    margin-right: 0;
}

/* Page Transitions */
.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Tab Switching Animations */
.role-form {
    animation: slideIn 0.4s ease-out;
}

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

/* Form Input Animations */
.form-control-modern:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Button Hover Effects */
.btn-login {
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

/* Role Card Hover Effects */
.role-card {
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 95, 160, 0.1), transparent);
    transition: left 0.5s;
}

.role-card:hover::before {
    left: 100%;
}

/* Loading States */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #2C5FA0;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error Messages */
.message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

.message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Utilities */
@media (max-width: 992px) {
    .info-section {
        margin-bottom: 2rem;
    }
    
    .login-section {
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .role-tabs {
        flex-direction: column;
    }
    
    .role-tab {
        width: 100%;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .main-footer,
    .role-tabs {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Keyboard Navigation */
*:focus {
    outline: 2px solid #2C5FA0;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #2C5FA0;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .role-card {
        border: 2px solid #212529;
    }
    
    .form-control-modern {
        border-width: 2px;
    }
}

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

/* Legacy Browser Support */
@supports not (display: flex) {
    .role-tabs {
        display: table;
        width: 100%;
    }
    
    .role-tab {
        display: table-cell;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2C5FA0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e4a7a;
}

/* Admin/Doctor Panels */
.admin-header,
.doctor-header {
    border-bottom: 1px solid rgba(44,95,160,0.10);
}

/* Sidebar list-group -> modern */
.list-group{
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(31,79,140,0.10);
    border: 1px solid rgba(44,95,160,0.10);
}

.list-group-item{
    border: 0;
    padding: 12px 14px;
    font-weight: 600;
    color: #314a62;
    background: #ffffff;
}

.list-group-item + .list-group-item{
    border-top: 1px solid rgba(44,95,160,0.08);
}

.list-group-item:hover{
    background: rgba(44,95,160,0.06);
}

.list-group-item.active{
    color: #0b2b4d;
    background: linear-gradient(135deg, rgba(44,95,160,0.18) 0%, rgba(90,167,255,0.22) 100%);
}

/* remove fixed widths that create gaps */
#nav-tabContent{
    width: auto !important;
}

/* cards: reuse existing .panel markup */
.panel.panel-white{
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(44,95,160,0.10);
    box-shadow: 0 12px 30px rgba(31,79,140,0.10);
}

.panel .panel-body{
    padding: 20px 18px;
}

.StepTitle{
    font-weight: 700;
    color: #0b2b4d;
}

/* modern buttons */
.btn.btn-primary{
    border: none;
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 14px;
    background: linear-gradient(135deg, #2C5FA0 0%, #5aa7ff 100%);
    box-shadow: 0 10px 22px rgba(44,95,160,0.20);
}

.btn.btn-primary:hover{
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(44,95,160,0.26);
}

/* ===== Admin/Doctor Panel Unified Styles ===== */

/* Panel page background */
.panel-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.panel-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/background2.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

/* Panel container */
.panel-container {
    padding-top: 30px;
    padding-bottom: 40px;
}

/* Welcome heading */
.welcome-heading {
    text-align: center;
    padding-bottom: 24px;
    font-family: 'Inter', 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    color: #123a66;
    font-size: 1.5rem;
}

/* Sidebar styling */
.panel-sidebar {
    margin-top: 20px;
}

/* Content area */
.panel-content {
    margin-top: 20px;
}

/* Dashboard cards row */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-cards .panel {
    flex: 1;
    min-width: 200px;
}

/* Table styling for panels */
.panel-page .table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.panel-page .table thead {
    background: linear-gradient(135deg, #2C5FA0 0%, #5aa7ff 100%);
    color: #fff;
}

.panel-page .table thead th {
    border: none;
    padding: 14px 12px;
    font-weight: 600;
}

.panel-page .table tbody td {
    padding: 12px;
    vertical-align: middle;
}

.panel-page .table tbody tr:hover {
    background: rgba(44, 95, 160, 0.04);
}

/* Card styling in panels */
.panel-page .card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.panel-page .card-body {
    padding: 24px;
}

/* Form controls in panels */
.panel-page .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 10px 14px;
}

.panel-page .form-control:focus {
    border-color: #2C5FA0;
    box-shadow: 0 0 0 3px rgba(44, 95, 160, 0.1);
}
