/* ============================================
   PATIENT PORTAL - COMPLETE STYLESHEET
   Mobile-First | PWA Optimized | All Devices
   WITH MOBILE HAMBURGER MENU
   ============================================ */

/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #0891b2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --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-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-3xl: 28px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #eef2ff 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- PORTAL WRAPPER ---------- */
.portal-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- HEADER STYLES ---------- */
.portal-header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.portal-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.portal-logo i {
    font-size: 28px;
    color: var(--primary);
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.portal-facility {
    font-size: 14px;
    color: var(--gray-500);
    display: none;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius-xl);
    transition: background 0.2s;
}

.portal-user:hover {
    background: var(--gray-100);
}

.portal-user-avatar i {
    font-size: 32px;
    color: var(--primary);
}

.portal-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.portal-user:hover .portal-dropdown {
    display: block;
}

.portal-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s;
}

.portal-dropdown a:hover {
    background: var(--gray-100);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 8px 0;
}

/* ---------- MOBILE MENU BUTTON (HAMBURGER) ---------- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    z-index: 101;
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ---------- MAIN CONTAINER (SIDEBAR + CONTENT) ---------- */
.portal-main-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 20px;
    gap: 24px;
}

/* ---------- SIDEBAR STYLES ---------- */
.portal-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: var(--radius-2xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 90px;
    transition: transform 0.3s ease;
}

/* Mobile Sidebar - Hidden by default, slides in */
@media (max-width: 768px) {
    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-radius: 0;
        height: 100%;
        overflow-y: auto;
        padding-top: 70px;
        box-shadow: var(--shadow-xl);
    }
    
    .portal-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .portal-main-container {
        padding: 16px;
        gap: 16px;
    }
}

.portal-welcome {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.portal-welcome h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.portal-welcome p {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

.portal-nav ul {
    list-style: none;
    padding: 0;
}

.portal-nav li {
    margin-bottom: 8px;
}

.portal-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.portal-nav li a i {
    width: 22px;
    font-size: 18px;
}

.portal-nav li.active a {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    font-weight: 600;
}

.portal-nav li a:hover:not(.active) {
    background: var(--gray-100);
    color: var(--primary);
}

.portal-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
}

.portal-badge.warning {
    background: var(--warning);
}

.portal-need-help {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

.portal-need-help i {
    font-size: 32px;
    color: var(--primary);
}

.portal-need-help h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.portal-need-help p {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.portal-need-help a {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}

/* Close button for mobile sidebar */
.mobile-sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-sidebar-close {
        display: flex;
    }
}

/* ---------- MAIN CONTENT AREA ---------- */
.portal-content {
    flex: 1;
    min-width: 0;
}

.portal-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.portal-page.active {
    display: block;
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.page-description {
    color: var(--gray-500);
    margin-top: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gray-50);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

/* Stats Cards Grid */
.patient-stats-grid,
.billing-summary-grid,
.lab-summary-grid,
.rx-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 26px;
    color: var(--primary);
}

.stat-details h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Appointment Cards */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appointment-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    border: 1px solid var(--gray-200);
}

.appointment-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.appointment-date .date-badge {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    padding: 8px 12px;
    text-align: center;
    min-width: 60px;
}

.date-badge .day {
    font-size: 24px;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.date-badge .month {
    font-size: 12px;
}

.appointment-details h4 {
    margin-bottom: 8px;
    font-size: 16px;
}

.appointment-details p {
    font-size: 13px;
    color: var(--gray-600);
    margin: 4px 0;
}

.appointment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s;
}

.message-item:hover {
    background: var(--gray-100);
}

.message-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
}

.message-avatar i {
    font-size: 40px;
    color: var(--primary);
}

.message-content {
    flex: 1;
}

.message-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.message-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 10px;
}

.message-content p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.message-time {
    font-size: 11px;
    color: var(--gray-400);
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 24px;
}

.quick-actions h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-btn {
    background: var(--gray-100);
    border: none;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Coming Soon Placeholder */
.coming-soon {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--radius-2xl);
}

.coming-soon i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.coming-soon h3 {
    font-size: 22px;
    color: var(--gray-600);
    margin-bottom: 10px;
}

/* Footer */
.portal-footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-500);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-container {
    background: white;
    border-radius: var(--radius-3xl);
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 24px 28px 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
}

.modal-body {
    padding: 24px 28px;
}

.modal-actions {
    padding: 16px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--gray-200);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

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

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Tablet and up (768px+) */
@media (min-width: 768px) {
    .portal-facility {
        display: block;
    }
    
    .portal-header-container {
        padding: 0 32px;
    }
    
    .portal-main-container {
        padding: 32px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .portal-header-container,
    .portal-main-container,
    .footer-container {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
    .portal-main-container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    
    /* Sidebar is handled by the mobile menu system, not inline */
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .patient-stats-grid,
    .billing-summary-grid,
    .lab-summary-grid,
    .rx-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .appointment-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .appointment-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Modal adjustments */
    .modal-container {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 20px 20px 0;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        padding: 16px 20px 20px;
    }
}

/* Small phones (up to 480px) */
@media (max-width: 480px) {
    .portal-header-container {
        padding: 0 12px;
        height: 60px;
    }
    
    .portal-logo span {
        font-size: 16px;
    }
    
    .portal-logo i {
        font-size: 22px;
    }
    
    .portal-user span {
        display: none;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 12px;
    }
    
    .message-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message-avatar i {
        font-size: 32px;
    }
}

/* Large phones (iPhone 12 Pro Max, etc.) */
@media (min-width: 430px) and (max-width: 768px) {
    .patient-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad and Tablet specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .portal-sidebar {
        width: 260px;
    }
    
    .patient-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .portal-header {
        padding-top: env(safe-area-inset-top);
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .portal-header-container,
    .portal-main-container,
    .portal-footer {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .modal-container {
        margin-top: env(safe-area-inset-top);
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 60px;
    color: var(--gray-400);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius-2xl);
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--gray-600);
}

.empty-state p {
    color: var(--gray-400);
    margin-bottom: 20px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

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

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

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Disable tap highlight on mobile */
button,
a,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

/* Better touch targets for mobile */
button,
.btn,
.portal-nav li a,
.action-btn {
    min-height: 44px;
}

@media (max-width: 768px) {
    button,
    .btn,
    .portal-nav li a,
    .action-btn {
        min-height: 48px;
    }
}

/* Print Styles */
@media print {
    .portal-sidebar,
    .portal-header,
    .portal-footer,
    .btn,
    .page-actions,
    .mobile-menu-btn {
        display: none;
    }
    
    .portal-main-container {
        padding: 0;
        display: block;
    }
    
    .portal-page {
        display: block !important;
    }
    
    body {
        background: white;
    }
}
/* ============================================
   BUTTON STYLES - Professional Design
   ============================================ */

/* Base Button Styles */
.btn, 
button:not(.tab-btn):not(.profile-tab-btn):not(.rx-tab-btn):not(.billing-tab-btn):not(.close-modal-btn):not(.mobile-menu-btn):not(.close-banner):not(.install-btn):not(.gotit-btn),
.action-btn,
.view-all,
[role="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

/* Primary Button - Blue Gradient */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary/Outline Button */
.btn-outline {
    background: white;
    border: 2px solid #e2e8f0;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Danger Button - Red */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

/* Success Button - Green */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Warning Button - Orange */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
}

/* Small Button Size */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    gap: 6px;
}

/* Large Button Size */
.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    gap: 10px;
}

/* Icon-only buttons */
.btn-icon {
    padding: 10px;
    border-radius: 10px;
}

.btn-icon i {
    margin: 0;
    font-size: 18px;
}

/* Disabled Button */
.btn:disabled,
.btn.disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Quick Action Buttons (Dashboard) */
.action-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px 18px;
    border-radius: 16px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn i {
    font-size: 18px;
    color: #2563eb;
    transition: all 0.2s;
}

.action-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    border-color: transparent;
}

.action-btn:hover i {
    color: white;
}

/* View All Links */
.view-all {
    background: transparent;
    color: #2563eb;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.view-all:hover {
    background: #eff6ff;
    transform: translateX(2px);
}

.view-all i {
    transition: transform 0.2s;
}

.view-all:hover i {
    transform: translateX(4px);
}

/* Tab Buttons */
.tab-btn,
.profile-tab-btn,
.rx-tab-btn,
.billing-tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    border-radius: 8px;
}

.tab-btn:hover,
.profile-tab-btn:hover,
.rx-tab-btn:hover,
.billing-tab-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.tab-btn.active,
.profile-tab-btn.active,
.rx-tab-btn.active,
.billing-tab-btn.active {
    color: #2563eb;
    border-bottom: 3px solid #2563eb;
    background: transparent;
}

/* Appointment Action Buttons */
.appointment-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.appointment-actions .btn-outline {
    border-color: #cbd5e1;
}

.appointment-actions .btn-outline:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.appointment-actions .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

/* Message Action Buttons */
.message-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Buttons */
.modal-actions .btn {
    min-width: 100px;
}

.modal-actions .btn-outline {
    background: white;
    border: 2px solid #e2e8f0;
}

.modal-actions .btn-outline:hover {
    background: #f8fafc;
    border-color: #2563eb;
}

/* Schedule New Appointment Button */
.page-header .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.page-header .btn-primary i {
    font-size: 16px;
}

.page-header .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

/* Back/Close Buttons */
.close-modal-btn,
.close-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.close-modal-btn:hover,
.close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Link Buttons (text that acts like button) */
.btn-link {
    background: transparent;
    border: none;
    color: #2563eb;
    padding: 8px 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Floating Action Button (for mobile) */
.btn-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    z-index: 90;
}

.btn-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

/* Prescription Refill Button */
.refill-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.refill-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* Join Call Button */
.join-btn {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
}

.join-btn:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

/* Download Button */
.download-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn,
    button:not(.tab-btn):not(.mobile-menu-btn) {
        padding: 10px 18px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .action-btn i {
        font-size: 16px;
    }
    
    .page-header .btn-primary {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* Hover effects for touch devices */
@media (hover: hover) {
    .btn:hover,
    .action-btn:hover,
    .view-all:hover {
        transform: translateY(-2px);
    }
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

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

/* Button Group (for multiple buttons together) */
.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    justify-content: center;
}

/* Full Width Button */
.btn-block {
    width: 100%;
    justify-content: center;
}

/* Social/Provider Buttons */
.btn-provider {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 14px;
    font-weight: 500;
}

.btn-provider i {
    font-size: 20px;
    margin-right: 8px;
}

.btn-provider:hover {
    border-color: #2563eb;
    background: #f8fafc;
}
.portal-wrapper {
    opacity: 0;
}



