/* Modern Beautiful Design */
html {
    min-height: 100%;
    position: relative;
}

body {
    background-color: #5468d4; /* Fallback color */
    background-image: url('../Images/GlobalBackground.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content wrapper - pushes footer to bottom */
.container {
    flex: 1 0 auto;
    padding: 2rem 0;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
    background: white;
}

.card-header {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    color: white;
    font-weight: 600;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* VERY DARK VISIBLE BORDERS */
.form-control, .form-select, input[type="text"], input[type="password"], textarea, select {
    border: 3px solid #000000 !important;
    background-color: #ffffff !important;
    border-radius: 8px;
    padding: 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #5468d4 !important;
    box-shadow: 0 0 0 0.25rem rgba(84, 104, 212, 0.25) !important;
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(84, 104, 212, 0.4);
}

.btn-secondary {
    background: #6c757d;
    border: none;
}

.btn-info {
    background: #128299;
    border: none;
}

.btn-warning {
    background: #ffc107;
    border: none;
    color: #000;
}

.btn-danger {
    background: #dc3545;
    border: none;
}

.btn-dark {
    background: #343a40;
    border: none;
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.table thead th:hover {
    opacity: 0.9;
}

.table thead th::after {
    content: ' ⇅';
    font-size: 0.8em;
    opacity: 0.6;
}

.table thead th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

.table thead th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Modals */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Footer - sticky to bottom when content is short */
footer {
    padding: 0;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: auto;
}

footer img {
    height: 30px; /* Increased by 50% from 20px */
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
}

.cookie-consent a {
    color: #1a8a6e;
    text-decoration: underline;
}

/* Powered by bar */
.powered-by-bar {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Sticky Header */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.powered-by-bar {
    position: sticky;
    top: 36px; /* Adjusted for ultra-compact navbar */
    z-index: 1029;
}

/* Provider info bar for clients */
.provider-info-bar {
    position: sticky;
    top: 54px; /* Adjusted: navbar (36px) + powered-by (18px) */
    z-index: 1028;
    padding: 4px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.provider-info-bar img {
    height: 75px; /* Increased by 50% from 50px */
}

/* Legacy class name support */
.clinic-info-bar {
    position: sticky;
    top: 54px;
    z-index: 1028;
}

/* Smaller/more compact navbar */
.navbar {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.navbar .navbar-brand img {
    height: 68px; /* Increased by 50% from 45px */
}

.navbar .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}

.navbar .nav-link {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    font-size: 0.85rem;
}

/* hdrEEG tag - fixed top right corner */
.hdrEEG-tag-container {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
}

/* When inside container, don't need positioning on the image */
.hdrEEG-tag-container .hdrEEG-tag-fixed {
    position: static;
}

/* Standalone usage (login page, etc.) - needs its own positioning */
.hdrEEG-tag-fixed {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    opacity: 0.95;
    height: 63px; /* Increased by 50% from 42px */
}

/* Data activity LED - tiny indicator on hdrEEG tag */
.data-led {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #333;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.data-led.active {
    background-color: #00ff88;
    box-shadow: 0 0 6px 2px rgba(0, 255, 136, 0.6), inset 0 0 2px rgba(255,255,255,0.3);
    animation: ledPulse 0.8s ease-in-out;
}

@keyframes ledPulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 8px 3px rgba(0, 255, 136, 0.8), inset 0 0 2px rgba(255,255,255,0.3);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 4px 1px rgba(0, 255, 136, 0.4), inset 0 0 2px rgba(255,255,255,0.2);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 6px 2px rgba(0, 255, 136, 0.6), inset 0 0 2px rgba(255,255,255,0.3);
    }
}

/* Navigation improvements */
.navbar .nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 2px;
}

.navbar .nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.navbar .nav-link.active {
    background: rgba(255,255,255,0.2);
}

/* Login page specific */
.min-vh-100 {
    display: flex;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Modal styling - let Bootstrap handle z-index and display */

/* Scrollbar for tables with more than 10 rows */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Custom scrollbar styling */
.table-responsive::-webkit-scrollbar {
    width: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    border-radius: 5px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5f3d85 0%, #5468d4 100%);
}

/* Tom Select styling to match site theme */
.ts-wrapper.single .ts-control {
    border: 3px solid #000000 !important;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    min-height: calc(1.5em + 1.5rem + 6px);
}

.ts-wrapper.single .ts-control:focus,
.ts-wrapper.single.focus .ts-control {
    border-color: #5468d4 !important;
    box-shadow: 0 0 0 0.25rem rgba(84, 104, 212, 0.25) !important;
}

.ts-dropdown {
    border: 2px solid #000000;
    border-radius: 8px;
    margin-top: 2px;
}

.ts-dropdown .option {
    padding: 0.5rem 0.75rem;
}

.ts-dropdown .option.active {
    background: linear-gradient(135deg, #5468d4 0%, #5f3d85 100%);
    color: white;
}
