/* Custom Premium Styles for Dentaltec Hub */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary: #0d9488;
    --accent: #10b981;
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
    --font-outfit: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--font-outfit);
    background-color: #0f172a; /* Dark sleek background for the workspace */
    color: #1e293b;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-premium);
}

.glass-panel-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

/* Scrollbar Customization */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

/* Custom UI Toggle Buttons */
.tooth-btn {
    font-family: var(--font-outfit);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid #e2e8f0;
    background: white;
    font-weight: 500;
}
.tooth-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}
.tooth-btn.selected {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
    transform: scale(1.05);
}

.ui-btn {
    transition: all 0.25s ease;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    background: white;
    font-weight: 500;
}
.ui-btn:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}
.ui-btn.selected {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes notificationPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.animate-fade-in {
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification-ring {
    animation: notificationPulse 2s infinite;
}

/* Phone Simulator styling */
.phone-container {
    background: #111827;
    border: 12px solid #374151;
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.phone-screen {
    background-color: #efeae2; /* WhatsApp background */
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
}

.phone-notch {
    width: 140px;
    height: 25px;
    background: #374151;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 50;
}

/* WhatsApp Message Bubble */
.wa-bubble-incoming {
    background: white;
    border-radius: 12px 12px 12px 0px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    max-width: 85%;
    align-self: flex-start;
}

.wa-bubble-outgoing {
    background: #d9fdd3;
    border-radius: 12px 12px 0px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    max-width: 85%;
    align-self: flex-end;
}

/* Dashboard Sidebar Active Style */
.sidebar-link {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.sidebar-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

/* Status Badges */
.badge-status {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-received { background-color: #e0f2fe; color: #0369a1; }
.badge-china { background-color: #fef3c7; color: #d97706; }
.badge-milling { background-color: #fae8ff; color: #a21caf; }
.badge-shipping { background-color: #d1fae5; color: #047857; }
.badge-completed { background-color: #dcfce7; color: #15803d; }

/* Mobile Optimizations (Responsive phone usage) */
@media (max-width: 640px) {
    /* 1. Make the order wizard modal full screen on mobile so it functions as a standalone app */
    #new-order-modal {
        padding: 0 !important;
    }
    #new-order-modal #order-modal-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    
    /* 2. Touch friendly sizing */
    .tooth-btn, .ui-btn {
        min-height: 48px; /* Safe mobile tap target */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .tooth-btn {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.25rem !important;
    }
    
    /* 3. Header stack behavior */
    header {
        padding: 0.75rem 1rem !important;
        gap: 0.5rem !important;
    }
    
    /* 4. Ensure tables scroll horizontally on small screens instead of breaking layouts */
    .overflow-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* FDI SVG Dental Chart Styling */
.svg-tooth-group path {
    cursor: pointer;
}
.svg-tooth-group:hover path {
    fill: #dbeafe !important; /* Soft blue hover fill */
    stroke: #3b82f6 !important;
}
.svg-tooth-group:hover text {
    fill: #3b82f6 !important;
}
