/* Custom Styles for ScanDuePlus */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-bg: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

/* Sidebar customization */
.sidebar {
    background: var(--sidebar-bg);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    color: white;
    border-radius: 0.375rem;
    margin: 0px 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

/* Content area - default padding for standard pages */
.content {
    padding: 1.5rem 1rem;
}

/* Full-width pages - no padding */
.about-page-content,
.welcome-page {
    margin: -1.5rem -1rem;
    padding: 0;
}

/* Empty layout full width */
.empty-layout .welcome-page {
    margin: 0;
    padding: 0;
}

/* Welcome and About pages button styles - Unified styling */
.welcome-login-btn,
.welcome-cta-btn,
.welcome-header-btn {
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 2rem;
}

.welcome-login-btn:hover,
.welcome-cta-btn:hover,
.welcome-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.welcome-login-btn:active,
.welcome-cta-btn:active,
.welcome-header-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.welcome-login-btn i,
.welcome-cta-btn i,
.welcome-header-btn i {
    font-size: 1.2rem;
}

/* Hero section button containers */
.hero-section .d-grid {
    max-width: 320px !important;
}

/* Features section styling - Full width */
.features-section {
    background: var(--light-color);
}

.features-section .feature-card {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.features-section .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Features section login button styling */
.features-section .welcome-login-btn {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 1rem 2.5rem;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
    border: none;
}

.features-section .welcome-login-btn:hover {
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4);
    transform: translateY(-3px);
}

/* Specific adjustments for CTA section buttons */
.welcome-cta-btn {
    font-size: 1.15rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Header button specific styling */
.welcome-header-btn {
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-radius: 0.75rem;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 500;
}

/* Button enhancements */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

/* Top bar styling */
.top-row {
    background: linear-gradient(180deg, rgb(5, 39, 103) 100%, #3a0647 70%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 60px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Top bar buttons styling */
.top-row .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    background: transparent;
}

.top-row .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: none;
    box-shadow: none;
}

.top-row .btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Gap utility for flex containers */
.gap-2 {
    gap: 0.5rem;
}

/* Dashboard specific styles */
.dashboard-header h1 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Statistics cards */
.bg-info {
    background: linear-gradient(135deg, var(--info-color), #0aa2c0) !important;
}

.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #d39e00) !important;
}

.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37) !important;
}

.bg-success {
    background: linear-gradient(135deg, var(--success-color), #146c43) !important;
}

/* Form enhancements */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badge styles */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}

/* Loading spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Dropdown enhancements */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 0.75rem;
    padding: 0.5rem 0;
    min-width: 180px;
}

.dropdown-item {
    border-radius: 0.375rem;
    margin: 2px 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: var(--light-color);
    transform: translateX(4px);
}

.dropdown-item:focus {
    background-color: var(--light-color);
    outline: none;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(var(--danger-color), 0.1);
    color: var(--danger-color);
}

.dropdown-divider {
    margin: 0.5rem 8px;
    border-color: #e9ecef;
}

/* Card dropdown button */
.card .btn-link {
    color: #6c757d;
    text-decoration: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.card .btn-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
    transform: none;
    box-shadow: none;
}

.card .btn-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1), rgba(10, 162, 192, 0.1));
    color: #055160;
}

/* Language selector */
.language-selector .form-select {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    min-width: 120px;
}

/* Empty state */
.text-center .fa-4x {
    opacity: 0.5;
}

/* Animation for new items */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideInUp 0.3s ease;
}

/* About and Welcome pages styles */
.about-page-content,
.welcome-page {
    padding: 0;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--sidebar-bg), #0056b3);
}

.hero-icon {
    opacity: 0.9;
}

.feature-card {
    padding: 2rem 1rem;
    text-align: center;
    border-radius: 1rem;
    transition: transform 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.stat-item {
    padding: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
}

.stat-label {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

.step-item {
    position: relative;
    padding: 2rem 1rem;
}

.step-number {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-icon {
    margin: 2rem 0 1rem;
}

.category-item {
    padding: 1.5rem 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    /* Top bar responsive adjustments */
    .top-row {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* About/Welcome pages responsive */
    .hero-section .display-3 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.2rem;
    }
    
    /* Features section responsive */
    .features-section .feature-card {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Features section on mobile - adjust columns */
    .features-section .col-lg-3 {
        margin-bottom: 1rem;
    }
    
    .step-item {
        padding: 1.5rem 0.5rem;
    }
    
    /* Content padding adjustment for mobile */
    .content {
        padding: 1rem 0.75rem;
    }
    
    /* Welcome page mobile button adjustments */
    .welcome-login-btn,
    .welcome-cta-btn,
    .welcome-header-btn {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .welcome-cta-btn {
        font-size: 1rem;
        padding: 0.85rem 1.8rem;
    }
    
    /* Features section login button mobile styling */
    .features-section .welcome-login-btn {
        font-size: 1rem;
        padding: 0.85rem 2rem;
    }
    
    /* Hero section container on mobile */
    .hero-section .d-grid {
        max-width: 280px !important;
    }
    
    /* Dropdown menu mobile adjustments */
    .dropdown-menu {
        min-width: 160px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #343a40;
    }
    
    .card {
        background-color: #343a40;
        color: #f8f9fa;
    }

    .text-muted {
        color: white !important;
    }

    /* .top-row {
        background: #343a40;
        border-bottom-color: #495057;
    }*/
    
    .dropdown-menu {
        background-color: #343a40;
        border: 1px solid #495057;
    }
    
    .dropdown-item {
        color: #f8f9fa;
    }
    
    .dropdown-item:hover {
        background-color: #495057;
        color: #f8f9fa;
    }
}

/* Scan page specific */
.scan-header h1 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Medicine and Refrigerator pages */
.medicine-header h1,
.refrigerator-header h1 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Settings page */
.settings-header h1 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Border utilities for item status */
.border-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-success {
    border-left: 4px solid var(--success-color) !important;
}

/* Text color utilities */
.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: #d39e00 !important;
}

.text-success {
    color: var(--success-color) !important;
}

/* Mobile sidebar styles */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .sidebar.sidebar-mobile-show {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 250px;
        background: var(--sidebar-bg);
        z-index: 2000;
        box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    }
}