/**
 * Sidebar Layout Styles
 * Ocean Trust Theme - Patient Portal
 */

/* ============================================
   SIDEBAR BASE STYLES
   ============================================ */

.sidebar {
    transition: transform 0.3s ease;
}

/* Sidebar navigation item states */
.sidebar-item {
    position: relative;
    border-left: 3px solid transparent;
    margin-left: -3px;
}

.sidebar-item.active {
    background: rgba(15, 76, 129, 0.1);
    color: #0f4c81;
    border-left-color: #0f4c81;
    font-weight: 600;
}

.sidebar-item:hover:not(.active) {
    background: rgba(15, 76, 129, 0.05);
    color: #0f4c81;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile: Sidebar hidden by default */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }
}

/* Desktop: Sidebar always visible */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
   CONTENT AREA STYLES
   ============================================ */

/* Cards and panels */
.content-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: rgba(15, 76, 129, 0.1);
    color: #0f4c81;
}

.stat-icon.secondary {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ============================================
   ACTIVITY LIST
   ============================================ */

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.activity-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.action-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: left;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.action-button.primary {
    background: rgba(15, 76, 129, 0.05);
    color: #1e293b;
}

.action-button.primary:hover {
    background: rgba(15, 76, 129, 0.1);
}

.action-button.default {
    background: #f8fafc;
    color: #1e293b;
}

.action-button.default:hover {
    background: #f1f5f9;
}

/* ============================================
   APPOINTMENT CARD
   ============================================ */

.appointment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 76, 129, 0.05);
    border-radius: 0.75rem;
}

.appointment-date {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    background: rgba(15, 76, 129, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.appointment-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f4c81;
    line-height: 1;
}

.appointment-date .month {
    font-size: 0.75rem;
    color: #0f4c81;
    text-transform: uppercase;
}

/* ============================================
   HEALTH REMINDER CARD
   ============================================ */

.reminder-card {
    background: linear-gradient(135deg, #0f4c81 0%, #0a3a66 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
}

.reminder-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.reminder-card p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.reminder-card button {
    width: 100%;
    background: white;
    color: #0f4c81;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reminder-card button:hover {
    background: #f1f5f9;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #0f4c81;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #0f4c81;
    color: white;
}

.btn-primary:hover {
    background: #0a3a66;
}

.btn-secondary {
    background: #0891b2;
    color: white;
}

.btn-secondary:hover {
    background: #0e7490;
}

.btn-outline {
    background: transparent;
    border: 2px solid #0f4c81;
    color: #0f4c81;
}

.btn-outline:hover {
    background: rgba(15, 76, 129, 0.1);
}

/* ============================================
   TABLES
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-info {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

.badge-primary {
    background: rgba(15, 76, 129, 0.1);
    color: #0f4c81;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #94a3b8;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   PREMIUM SIDEBAR & PAYWALL STYLES
   ============================================ */

/* Premium group label */
.premium-group-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Lock/star icon on premium sidebar items */
.premium-lock-icon {
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Paywall overlay — full screen frosted glass */
.paywall-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 245, 249, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.paywall-overlay.hidden {
    display: none;
}

/* Paywall card */
.paywall-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    max-width: 28rem;
    width: 90%;
    text-align: center;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(245, 158, 11, 0.15);
    animation: paywallSlideUp 0.4s ease-out;
}

/* Star icon circle */
.paywall-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

/* Feature checklist */
.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0 auto 1.5rem;
    max-width: 18rem;
    text-align: left;
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: #334155;
}

.paywall-features li i {
    color: #f59e0b;
    font-size: 1rem;
    flex-shrink: 0;
}

/* CTA button */
.paywall-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.9375rem;
    color: white;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.paywall-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Slide-up animation */
@keyframes paywallSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive: offset paywall for sidebar on desktop */
@media (min-width: 1024px) {
    .paywall-overlay {
        left: 16rem;
        /* match sidebar width (w-64 = 16rem) */
    }
}

/* ============================================
   iOS SAFE AREA & CAPACITOR NATIVE STYLES
   ============================================ */

/* Safe area insets for notched iPhones (Dynamic Island, home indicator) */
html.capacitor-native body {
    /* Prevent content from going under status bar / home indicator */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Adjust fixed sidebar for safe area on iOS */
html.capacitor-native .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Adjust sticky header for safe area */
html.capacitor-native header.sticky {
    top: env(safe-area-inset-top);
}

/* When keyboard is open, reduce bottom padding */
html.capacitor-native body.keyboard-open {
    padding-bottom: 0;
}

/* Disable text selection on native (feels more app-like) */
html.capacitor-native {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Re-enable text selection on inputs and text areas */
html.capacitor-native input,
html.capacitor-native textarea,
html.capacitor-native [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

/* Smooth overscroll bounce (native iOS feel) */
html.capacitor-native main {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}