/* Global Styles for Innovalign 6.0 */

/* Color Variables - Based on dental branding */
:root {
    /* Primary Colors */
    --primary-blue: rgb(67, 108, 187);
    --primary-dark: rgb(50, 85, 150);
    --primary-light: rgb(90, 130, 210);
    --primary-color: rgb(67, 108, 187);

    /* Secondary Colors */
    --secondary-teal: #00A896;
    --secondary-green: #05C46B;

    /* Neutral Colors */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;

    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    --danger-color: #EF4444;

    /* Layout */
    --nav-height: 64px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --bg-secondary: #F9FAFB;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
}

/* Main content area - add padding for fixed navigation */
main {
    min-height: 100vh;
}

/* Only add padding when navigation is present (authenticated users) */
body.authenticated main {
    padding-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Links */
a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
}

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

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

.btn-secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-text {
    background: transparent;
    color: var(--primary-blue);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-text:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #DC2626;
}

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Switcher */
.nav-language {
    position: relative;
    margin-right: 0.5rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    transition: background 0.3s;
    font-size: 0.875rem;
    font-weight: 500;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.language-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 200px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.language-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.language-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.language-list {
    padding: 0.5rem 0;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.language-item:hover {
    background: var(--gray-50);
}

.language-item.active {
    background: var(--gray-100);
    color: var(--primary-blue);
    font-weight: 600;
}

.language-flag {
    font-size: 1.25rem;
}

.language-name {
    flex: 1;
    font-size: 0.875rem;
}

.language-check {
    width: 16px;
    height: 16px;
    color: var(--primary-blue);
}

/* Notifications */
.nav-notifications {
    position: relative;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 350px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.notification-list {
    padding: 0.5rem;
}

.no-notifications {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.notification-item {
    position: relative;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: start;
    gap: 0.5rem;
}

.notification-item:hover {
    background: #F3F4F6;
}

.notification-item.unread {
    background: #EFF6FF;
}

.notification-item.unread:hover {
    background: #DBEAFE;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1F2937;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: #6B7280;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.mark-read-btn {
    background: #10B981;
    color: white;
    border: none;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mark-read-btn:hover {
    background: #059669;
}

/* Profile */
.nav-profile {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.profile-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.profile-name {
    font-weight: 500;
}

.profile-arrow {
    width: 16px;
    height: 16px;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    max-width: 350px;
    width: max-content;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
}

.profile-info {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
}

.profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.profile-avatar-large-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
}

.profile-username {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
}

.profile-divider {
    height: 1px;
    background: var(--border-color);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s;
}

.profile-menu-item:hover {
    background: var(--bg-secondary);
}

.profile-menu-item svg {
    width: 20px;
    height: 20px;
}

.profile-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--danger-color);
    text-decoration: none;
    transition: background 0.3s;
}

.profile-logout:hover {
    background: var(--bg-secondary);
}

.profile-logout svg {
    width: 20px;
    height: 20px;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--error);
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--info);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Icon Sizes */
svg.w-3, .w-3 { width: 0.75rem; height: 0.75rem; }
svg.w-4, .w-4 { width: 1rem; height: 1rem; }
svg.w-5, .w-5 { width: 1.25rem; height: 1.25rem; }
svg.w-6, .w-6 { width: 1.5rem; height: 1.5rem; }

svg.h-3, .h-3 { height: 0.75rem; }
svg.h-4, .h-4 { height: 1rem; }
svg.h-5, .h-5 { height: 1.25rem; }
svg.h-6, .h-6 { height: 1.5rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Flash Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: white;
    border-left: 4px solid;
    animation: slideInNotification 0.3s ease;
}

.alert-success {
    border-left-color: #10b981;
    background: #f0fdf4;
    color: #166534;
}

.alert-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

/* Global Notification */
.notification {
    position: fixed !important;
    top: 80px !important;
    right: 2rem !important;
    background: white !important;
    padding: 1rem 1.5rem !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 999 !important;
    display: none;
    align-items: center !important;
    gap: 0.75rem !important;
    min-width: 300px !important;
}

.notification.show {
    display: flex !important;
    animation: slideInNotification 0.3s ease;
}

@keyframes slideInNotification {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.success i {
    color: #10b981;
}

.notification.error i {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 0.75rem;
    }
}

