/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #2d3748;
}

/* Navigation Styling */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none !important;
}

.navbar-brand::before {
    content: "🏥 ";
    font-size: 1.2rem;
}

/* Button Animations and Styles */
.btn {
    border-radius: 12px !important;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

/* Cards and Containers */
.card {
    border-radius: 20px !important;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(31, 38, 135, 0.3);
}

.card-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-weight: 700;
    color: #667eea;
    border-radius: 20px 20px 0 0 !important;
    padding: 1.2rem;
}

.card-body {
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    margin: 2rem 0;
    text-align: center;
    color: white;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

/* Alert Styles */
.alert {
    border-radius: 15px;
    border: none;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(72, 187, 120, 0.15);
    color: #2f855a;
    border-left: 4px solid #48bb78;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.15);
    color: #c53030;
    border-left: 4px solid #f56565;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.15);
    color: #c05621;
    border-left: 4px solid #ed8936;
}

/* Table Styling */
.table {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(31, 38, 135, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.2rem;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Container */
.container {
    max-width: 1200px;
}

main.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    margin: 2rem auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Footer */
footer {
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-section p, .footer-section a {
    color: #a0aec0;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    color: #718096;
}

/* Page Headers */
h3 {
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    text-align: center;
}

h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 1rem auto;
    border-radius: 2px;
}

/* QR Scanner Styling */
#reader {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(31, 38, 135, 0.2);
    margin: 0 auto;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Icon Styles */
.icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Status Badges */
.badge-status {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-approved {
    background: linear-gradient(135deg, #48bb78 0%, #68d391 100%);
    color: white;
}

.badge-pending {
    background: linear-gradient(135deg, #ed8936 0%, #fbb040 100%);
    color: white;
}

.cards-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card-small {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    min-width: 180px;
}

.mt-16 {
    margin-top: 16px;
}

/* ========== NEW CUSTOMER VIEW STYLES ========== */
.product-verification-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.2);
}

.product-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    padding: 2rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.verification-badge {
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 1rem;
}

.badge-original {
    background: linear-gradient(135deg, #48bb78 0%, #68d391 100%);
    color: white;
}

.badge-fake {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.badge-suspected {
    background: linear-gradient(135deg, #ed8936 0%, #f6ad55 100%);
    color: white;
}

.risk-meter {
    height: 12px;
    border-radius: 6px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 1rem 0;
}

.risk-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}

.risk-low { background: linear-gradient(90deg, #48bb78, #68d391); }
.risk-medium { background: linear-gradient(90deg, #ed8936, #f6ad55); }
.risk-high { background: linear-gradient(90deg, #f56565, #e53e3e); }

.ingredient-list {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.ingredient-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
}

.ingredient-item:last-child {
    border-bottom: none;
}

.coa-preview {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.coa-preview:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.safety-tips {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-left: 4px solid #38b2ac;
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

/* ========== NEW COMPANY DASHBOARD STYLES ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

.stats-label {
    color: #718096;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.batch-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: #c6f6d5; color: #22543d; }
.status-recalled { background: #fed7d7; color: #742a2a; }
.status-suspended { background: #feebc8; color: #744210; }

/* ========== NEW CHARTS AND GRAPHS ========== */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========== NEW GOVERNMENT/REGULATOR STYLES ========== */
.regulator-export-card {
    border: 2px solid #4299e1;
    border-radius: 15px;
    overflow: hidden;
}

.export-format-badge {
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========== NEW COLLAPSIBLE SECTIONS ========== */
.collapsible-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
}

.section-header {
    background: #f7fafc;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.section-header:hover {
    background: #edf2f7;
}

.section-content {
    padding: 1.5rem;
    display: none;
}

.section-content.show {
    display: block;
}

/* ========== NEW QR SCANNER STYLES ========== */
.qr-scanner-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.qr-scanner-video {
    width: 100%;
    border-radius: 15px;
    border: 3px solid #667eea;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 3px solid #48bb78;
    border-radius: 15px;
    animation: pulse-frame 2s infinite;
}

@keyframes pulse-frame {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== NEW UPLOAD AREA STYLES ========== */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
    margin: 0.5rem 0;
}

/* ========== NEW RESPONSIVE UTILITIES ========== */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* ========== NEW ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ========== NEW UTILITY CLASSES ========== */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ========== NEW BADGE VARIANTS ========== */
.badge-quality-good { background: linear-gradient(135deg, #48bb78, #38a169); color: white; }
.badge-quality-moderate { background: linear-gradient(135deg, #ed8936, #dd6b20); color: white; }
.badge-quality-risky { background: linear-gradient(135deg, #f56565, #e53e3e); color: white; }

.confidence-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.confidence-text {
    font-size: 0.875rem;
    color: #718096;
}