/* Custom styles for DIVNOTE Psychology Session Assistant */

:root {
    --divnote-primary: #007bff;
    --divnote-secondary: #6c757d;
    --divnote-success: #28a745;
    --divnote-warning: #ffc107;
    --divnote-danger: #dc3545;
    --divnote-info: #17a2b8;
}

/* Navigation Bar Improvements */
.navbar {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 4px;
    padding: 8px 12px !important;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

/* Healthcare-specific styling */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Patient profile cards */
.patient-card {
    transition: transform 0.2s ease;
}

.patient-card:hover {
    transform: translateY(-2px);
}

/* Session status badges */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
}

/* Audio recording specific styles */
.recording-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--divnote-danger);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Transcription display */
.transcription-text {
    background-color: var(--bs-light);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* AI summary styling */
.ai-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
}

.ai-summary h6 {
    color: rgba(255, 255, 255, 0.9);
}

/* Treatment status indicators */
.treatment-status {
    position: relative;
    padding-left: 1.5rem;
}

.treatment-status::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bs-secondary);
}

.treatment-status.assigned::before {
    background-color: var(--bs-secondary);
}

.treatment-status.in-progress::before {
    background-color: var(--bs-warning);
}

.treatment-status.completed::before {
    background-color: var(--bs-success);
}

.treatment-status.discontinued::before {
    background-color: var(--bs-danger);
}

/* Professional header styling */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--divnote-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* =======================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ======================================= */

/* Mobile-First Base Styles */
.btn {
    min-height: 44px; /* Touch-friendly button height */
}

.form-control, .form-select {
    min-height: 44px; /* Touch-friendly input height */
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Small mobile devices (320px - 575px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Typography scaling */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Navigation adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 15px !important;
        text-align: center;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    /* Button groups stack vertically */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 0;
    }
    
    /* Form optimizations */
    .form-label {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .form-control-sm, .form-select-sm {
        min-height: 40px;
        font-size: 14px;
    }
    
    /* Patient form specific */
    .patient-form .row > div {
        margin-bottom: 1rem;
    }
    
    /* Stats cards single column */
    .stats-row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Hide non-essential elements on very small screens */
    .text-muted.small {
        font-size: 0.8rem;
    }
    
    /* Touch-friendly dropdown */
    .dropdown-menu {
        min-width: 200px;
        font-size: 1rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Mobile devices (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    /* Two-column layout for some forms */
    .patient-form .row .col-6 {
        flex: 0 0 50%;
    }
    
    /* Better card spacing */
    .card-body {
        padding: 1rem;
    }
    
    /* Improved button groups */
    .btn-group-horizontal {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .btn-group-horizontal .btn {
        flex: 1;
    }
}

/* Tablets (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Optimize patient cards for tablets */
    .patient-cards .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Form improvements */
    .patient-form .col-md-6 {
        padding-right: 1rem;
        padding-left: 1rem;
    }
    
    /* Dashboard stats */
    .stats-cards .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 1rem;
    }
    
    /* Navigation adjustments */
    .navbar-nav .nav-link {
        padding: 8px 10px !important;
        margin: 0 2px;
    }
}

/* Large tablets / small desktops (992px - 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    /* Three-column patient cards */
    .patient-cards .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    /* Form layout optimization */
    .patient-form .col-md-4 {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }
}

/* Desktop and large screens (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Larger patient cards on big screens */
    .patient-cards .col-xl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Extra large screens (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Even more columns on very large screens */
    .patient-cards .col-xxl-3 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Landscape mobile optimization */
@media (max-width: 767.98px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape */
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
    
    /* Compact navigation */
    .navbar {
        min-height: 50px;
    }
    
    /* Reduce card padding */
    .card-body {
        padding: 0.75rem;
    }
}

/* Dark theme responsive adjustments */
@media (max-width: 767.98px) {
    [data-bs-theme="dark"] .card {
        background-color: var(--bs-dark);
        border: 1px solid rgba(255, 255, 255, 0.15);
        margin-bottom: 1rem;
    }
    
    [data-bs-theme="dark"] .btn-outline-primary {
        border-width: 1px;
    }
    
    [data-bs-theme="dark"] .form-control,
    [data-bs-theme="dark"] .form-select {
        background-color: var(--bs-dark);
        border-color: rgba(255, 255, 255, 0.25);
        color: var(--bs-light);
    }
}

/* Touch device specific styles */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 8px 12px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
}

/* High DPI display optimization */
@media (min-resolution: 192dpi), (min-resolution: 2dppx) {
    /* Crisper borders and shadows for high DPI */
    .card {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
    }
    
    .navbar {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
    }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .transcription-text {
    background-color: var(--bs-dark);
    color: var(--bs-light);
}

[data-bs-theme="dark"] .card {
    background-color: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

/* Professional footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    margin-top: auto;
}

/* Accessibility improvements */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Print styles for session summaries */
@media print {
    .navbar,
    .btn,
    .card-header,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .transcription-text {
        background-color: transparent !important;
        border: 1px solid #ccc;
    }
}

/* Medical information styling */
.medical-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--divnote-info);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* Session timeline */
.session-timeline {
    position: relative;
    padding-left: 2rem;
}

.session-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--divnote-primary), var(--divnote-info));
}

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

.session-timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--divnote-primary);
    border: 3px solid var(--bs-body-bg);
}

/* Security and privacy indicators */
.security-badge {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 0 0 12px 12px;
}

/* Authentication page styling */
.auth-card {
    border-radius: 16px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
}

.security-badge-container .badge {
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.feature-grid {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Professional button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid var(--bs-primary);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Animated gradient background for auth pages */
.auth-bg {
    background: linear-gradient(-45deg, #1e3c72, #2a5298, #007bff, #6610f2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
