/* public/css/base.css */

/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f4f7f9; /* Lighter, cleaner background */
    color: #333;
    line-height: 1.6;
}

/* Global theme variables */
:root {
    /* Primary brand color and RGB fallback for opacity-based effects */
    --primary-color: var(--brand-primary, #667eea);
    /* If brand-primary is defined elsewhere, parse match not possible in CSS; provide explicit RGB fallback */
    --primary-rgb: 102, 126, 234; /* corresponds to #667eea */
}

/* --- Global Loading Spinner --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.loading-content { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 20px; }
.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--brand-primary, #667eea);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
.loading-messages { max-width: 520px; }
.loading-primary { font-weight: 700; color: #1f2937; font-size: 1.05rem; }
.loading-secondary { color: #4b5563; font-size: 0.95rem; margin-top: 4px; min-height: 1.2em; }
.loading-dots { margin-top: 10px; }
.loading-dots .dot { display: inline-block; width: 6px; height: 6px; margin: 0 2px; background: #9ca3af; border-radius: 50%; opacity: 0.3; animation: pulse 1.4s infinite ease-in-out; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 80%, 100% { transform: scale(0.9); opacity: 0.3; } 40% { transform: scale(1.2); opacity: 1; } }
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- SHARED LAYOUT CONTAINERS --- */
.dashboard-wrapper, .app-container {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f7f9; /* Updated background */
}
.app-container {
    background-color: #FFFFFF; /* Patient view is on a clean white background */
}
.confetti-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* --- GENERIC BUTTON STYLES --- */
.btn {
    padding: 12px 20px; /* Increased padding */
    border: 2px solid transparent; /* Border for outline styles */
    border-radius: 12px; /* Softened border radius */
    font-weight: 600; /* Slightly less bold */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 1em; /* Larger base font size */
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space for icons */
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}
.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* --- GENERIC FORM & INPUT STYLES (for app/dashboard) --- */
.input-group {
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s ease-in-out;
}
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
.field-note {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
}