/* MyDoc Patient Portal - Custom Styles */

/* Root Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f97316;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-850: #18202f;
    --gray-900: #111827;
}

/* Dark Mode Variables */
.dark {
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
}

/* Theme Transition */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

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

/* Function Bar Styles */
#main_content .bg-gray-850 {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark #main_content .bg-gray-850 {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Dark Mode Custom Colors */
.dark .bg-gray-850 {
    background-color: var(--gray-850);
}

/* Sidebar Transitions */
#mnu_main {
    transition: transform 300ms ease-in-out;
    will-change: transform;
}

#mnu_main.-translate-x-full {
    transform: translateX(-100%);
}

#mnu_main:not(.-translate-x-full) {
    transform: translateX(0);
}

#main_content {
    transition: margin-left 300ms ease-in-out;
}

/* Desktop Sidebar Margin */
@media (min-width: 1024px) {
    #main_content.lg\:ml-64 {
        margin-left: 16rem; /* 64 * 0.25rem */
    }
}

/* Fix for Tailwind transform utilities */
.-translate-x-full {
    --tw-translate-x: -100%;
    transform: translateX(var(--tw-translate-x));
}

/* Navigation Active State */
.nav-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.dark .nav-item.active {
    background-color: rgba(156, 163, 175, 0.2);
    color: #e5e7eb;
}

.nav-item.active i {
    color: var(--primary-color) !important;
}

.dark .nav-item.active i {
    color: #e5e7eb !important;
}

/* Loading States */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: var(--gray-200);
    }
    100% {
        background-color: var(--gray-300);
    }
}

/* Form Elements */
input, textarea, select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button States */
button {
    transition: all 0.2s ease-in-out;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Slide Animations */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

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

/* PWA Install Banner */
#install_banner {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive Grid System */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Utility Classes */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Print Styles */
@media print {
    header, nav, #install_banner {
        display: none !important;
    }
    
    main {
        margin: 0 !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* 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 Visible */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom Component Styles */
.appointment-card {
    border-left: 4px solid var(--primary-color);
}

.invoice-status-paid {
    color: var(--success-color);
}

.invoice-status-pending {
    color: var(--warning-color);
}

.prescription-active {
    border-color: var(--success-color);
}

.prescription-expired {
    border-color: var(--danger-color);
    opacity: 0.7;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed var(--gray-300);
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

/* Calendar Styles */
.calendar-day {
    min-height: 80px;
}

.calendar-day.today {
    background-color: rgba(37, 99, 235, 0.1);
    font-weight: bold;
}

.calendar-day.has-appointment {
    background-color: rgba(34, 197, 94, 0.1);
}

/* Questionnaire Progress */
.progress-bar {
    background-color: var(--gray-200);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background-color: var(--primary-color);
    height: 100%;
    transition: width 0.3s ease;
}

/* Document Signature Canvas */
.signature-canvas {
    border: 1px solid var(--gray-300);
    background-color: white;
    cursor: crosshair;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}