/* VIVID Malaysia Custom Styles */

:root {
    --vivid-primary: rgba(212, 64, 132, 1);
    --vivid-secondary: #6c757d;
    --vivid-success: #198754;
    --vivid-danger: #dc3545;
    --vivid-warning: #ffc107;
    --vivid-info: #0dcaf0;
    --bs-body-font-family: 'Roboto', sans-serif;
}

/* General Styles */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.navbar-brand {
    font-size: 1.5rem;
}

/* navigation */
.flag-icon {
    width: 39px;
    height: 28px;
    object-fit: cover;
}

.btn-login {
    border-radius: 20px;
    padding: 6px 37px;
    font-weight: 500;
    color: var(--vivid-primary);
}

/* header section */
.vivid-subnav-wrapper {
    border-bottom: 1px solid var(--vivid-primary);
}

.vivid-subnav {
    margin-bottom: 0;
}

.vivid-subnav .nav-link {
    color: #333;
    padding: 12px 50px;
    position: relative;

    transition:
        color 180ms ease,
        transform 180ms ease,
        opacity 180ms ease;
}

.vivid-subnav .nav-link::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--vivid-primary);
    transform: translateX(-50%);
    transition: width 220ms ease;
}

.vivid-subnav .nav-link:hover {
    color: var(--vivid-primary);
    transform: translateY(-1px);
}

.vivid-subnav .nav-link:hover::after {
    width: 100%;
}

.vivid-subnav .nav-link.active {
    color: var(--vivid-primary);
}

.vivid-subnav .nav-link.active::after {
    left: 0;
    width: 100%;
    transform: none;
}

/* footer */
.footer-custom {
    background-color: rgba(41, 55, 69, 1);
}

.footer-custom h4 {
    letter-spacing: 2px;
}

.footer-logo {
    max-height: 60px;
    filter: brightness(0) invert(1);
}

/* home */
.hero-section {
    position: relative;
    min-height: 558px;
    background: url("../img/banner.png") center/cover no-repeat;

    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 91.24%);
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    max-width: 600px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-overlay h1 {
    font-weight: 700;
}

.btn-pink {
    background: var(--vivid-primary);
    color: white;
    border-radius: 999px;
    padding: 10px 28px;
}

/* Card Enhancements */
.card {
    border: none;
}

.card-header {
    background: var(--vivid-primary);
    color: white;
    border-bottom: none;
}

/* Demo Page Styles */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: var(--vivid-primary);
    background: #e7f3ff;
}

.upload-area.dragover {
    border-color: var(--vivid-success);
    background: #d1e7dd;
}

.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Analysis Results */
.analysis-result {
    border-left: 4px solid var(--vivid-info);
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.analysis-result.violation {
    border-left-color: var(--vivid-danger);
    background: #fff5f5;
}

.analysis-result.clean {
    border-left-color: var(--vivid-success);
    background: #f0fff4;
}

.confidence-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #e9ecef;
}

.confidence-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.confidence-high { background: var(--vivid-success); }
.confidence-medium { background: var(--vivid-warning); }
.confidence-low { background: var(--vivid-danger); }

/* Admin Styles */
.admin-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Product Gallery */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Rules Table */
.rules-table {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.table th {
    /* background: var(--vivid-primary); */
    background: rgba(242, 242, 247, 1);
    color: black;
    border: none;
    font-weight: 600;
}

.violation-label {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #e7f3ff;
    color: #0056b3;
    border: 1px solid #b3d9ff;
    margin: 0.125rem;
}

/* Specific violation label colors */
.violation-label:contains("Health Claim") { background: #fff3cd; color: #856404; border-color: #ffeaa7; }
.violation-label:contains("Age Targeting") { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.violation-label:contains("Medical Endorsement") { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.violation-label:contains("Breast Milk") { background: #e2e3e5; color: #383d41; border-color: #d6d8db; }
.violation-label:contains("Infant Formula") { background: #f0f4ff; color: #2c5aa0; border-color: #c7d2fe; }
.violation-label:contains("Follow-up") { background: #f0fff4; color: #166534; border-color: #bbf7d0; }
.violation-label:contains("Feeding Equipment") { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.violation-label:contains("Complementary") { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--vivid-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .demo-container {
        padding: 0 1rem;
    }
    
    .upload-area {
        padding: 1rem;
    }
    
    .product-gallery {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Error Page Styles */
.error-container {
    text-align: center;
    padding: 4rem 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: var(--vivid-primary);
    opacity: 0.7;
}

/* JSON Display */
.json-display {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-key { color: #63b3ed; }
.json-string { color: #68d391; }
.json-number { color: #fbb6ce; }
.json-boolean { color: #f6ad55; }
.json-null { color: #a0aec0; }

/* Auto-detection page styles */
.auto-detection-table {
    font-size: 0.9rem;
}

.auto-detection-table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    vertical-align: middle;
    padding: 0.75rem;
}

.auto-detection-table thead tr:first-child th {
    border-bottom: 1px solid #dee2e6;
}

.auto-detection-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.auto-detection-table tbody tr:hover {
    background-color: #f8f9fa;
}

.auto-detection-table td {
    vertical-align: middle;
    padding: 0.75rem;
}

.violation-status-icons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

/* Filter section styles */
#filterForm .input-group-text {
    border-right: none;
}

#filterForm .form-control,
#filterForm .form-select {
    border-left: none;
}

#filterForm .form-control:focus,
#filterForm .form-select:focus {
    border-left: 1px solid #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#filterForm .input-group:focus-within .input-group-text {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.pagination .page-link {
    color: rgba(99, 99, 102, 1);
    border: 0;
    border-radius: 8px;
    margin-inline: 10px;
}

.pagination .page-item.active .page-link {
    background-color: rgba(212, 64, 132, 0.1);
    border-color: rgba(212, 64, 132, 0.1);
    color: var(--vivid-primary);
}

.pagination .page-link:hover {
    color: var(--vivid-primary);
}
