/* Custom Styles for NicheLab AI */

.hero-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    z-index: -1;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 1rem;
}

.pricing-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    border-color: #667eea;
    transform: scale(1.05);
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
}

.channel-card {
    border-left: 4px solid #667eea;
}

.health-grade {
    font-size: 2rem;
    font-weight: bold;
}

.health-grade.grade-a { color: #28a745; }
.health-grade.grade-b { color: #17a2b8; }
.health-grade.grade-c { color: #ffc107; }
.health-grade.grade-d { color: #dc3545; }

.niche-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.25rem;
}

.dashboard-sidebar {
    min-height: calc(100vh - 56px);
    background-color: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--bs-tertiary-bg);
    border-left-color: #667eea;
    color: #667eea;
}

.sidebar-divider {
    border-top: 1px solid var(--bs-border-color);
    opacity: 0.5;
}

.table-hover tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .stat-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .card {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE, TABLET, DESKTOP */
/* ============================================ */

/* Mobile First Approach - Base styles above are for mobile */

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Small devices (phones, 576px and up) */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
    }
    
    /* Stack buttons vertically on mobile */
    .hero-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Reduce card padding on mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Feature icons smaller on mobile */
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    /* Stats cards stack better */
    .stat-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* Dashboard sidebar hidden on mobile (Bootstrap handles toggle) */
    .dashboard-sidebar {
        min-height: auto;
    }
    
    /* Pricing cards no scale effect on mobile */
    .pricing-card.featured {
        transform: scale(1);
    }
    
    /* Reduce health grade size */
    .health-grade {
        font-size: 1.5rem;
    }
    
    /* Navbar brand smaller */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Dropdown menus full width on mobile */
    .dropdown-menu {
        width: 100%;
    }
    
    /* CRITICAL: Touch-friendly navbar links (44px minimum) */
    .navbar-nav .nav-link {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-item {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-header {
        padding-top: 0.75rem;
        padding-bottom: 0.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .hero-section {
        padding: 80px 0;
    }
    
    /* Adjust pricing card scale for tablets */
    .pricing-card.featured {
        transform: scale(1.03);
    }
    
    /* 2 column layout for features */
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    /* Touch-friendly navigation for tablets */
    .navbar-nav .nav-link {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        min-height: 44px;
    }
    
    .dropdown-item {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        min-height: 44px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Full sidebar visible */
    .dashboard-sidebar {
        display: block !important;
    }
    
    /* Better spacing for desktop */
    .hero-section {
        padding: 100px 0;
    }
    
    /* Optimal card hover effects */
    .pricing-card:hover {
        transform: translateY(-10px);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* More padding for large screens */
    .hero-section {
        padding: 120px 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .pricing-card:hover {
        transform: none;
    }
    
    .sidebar-link:hover {
        background-color: transparent;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .sidebar-link {
        padding: 1rem 1.25rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .dashboard-sidebar,
    .btn,
    .spinner-overlay {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
}

/* High DPI/Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images and icons look crisp */
    .feature-icon,
    .navbar-brand,
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================ */
/* MOBILE SIDEBAR TOGGLE BUTTON */
/* ============================================ */

/* Mobile sidebar menu button - purple gradient matching navbar */
.mobile-sidebar-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.mobile-sidebar-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.mobile-sidebar-toggle:active {
    transform: translateY(0);
}

/* Offcanvas sidebar styling */
.offcanvas-md {
    background-color: var(--bs-body-bg);
}

.offcanvas-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.offcanvas-header .btn-close {
    filter: invert(1);
}

/* Dark mode offcanvas */
[data-bs-theme="dark"] .offcanvas-md {
    background-color: #161b22;
    border-right: 1px solid #30363d;
}

[data-bs-theme="dark"] .offcanvas-header {
    border-bottom-color: #30363d;
}

/* Sidebar links in offcanvas */
.offcanvas-body .sidebar-link {
    transition: all 0.2s;
}

/* Mobile Menu Button - Compact Square - MOBILE ONLY */
button.mobile-menu-btn,
.mobile-menu-btn {
    position: fixed !important;
    top: 70px !important;
    left: 15px !important;
    z-index: 1040 !important;
    width: 48px !important;
    max-width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    max-height: 48px !important;
    min-height: 48px !important;
    flex: 0 0 48px !important;
    flex-basis: 48px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

button.mobile-menu-btn:hover,
.mobile-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4) !important;
}

button.mobile-menu-btn i,
.mobile-menu-btn i {
    font-size: 24px !important;
    line-height: 1 !important;
    color: white !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* HIDE button on desktop (768px and above) */
@media (min-width: 768px) {
    button.mobile-menu-btn,
    .mobile-menu-btn {
        display: none !important;
    }
}

/* Mobile - ensure main content is visible */
@media (max-width: 767.98px) {
    .dashboard-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 1050;
    }
    
    .dashboard-sidebar.show {
        left: 0;
    }
    
    /* Ensure content is not hidden */
    .col-md-9.col-lg-10 {
        width: 100% !important;
        padding-top: 1rem;
    }
}

/* Tool Card Styles */
.tool-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.3);
}

.tool-card i {
    transition: all 0.3s ease;
}

.tool-card:hover i {
    transform: scale(1.2);
}

.tool-card span {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Responsive adjustments for tool cards */
@media (max-width: 768px) {
    .tool-card span {
        font-size: 0.8rem;
    }
    .tool-card i {
        font-size: 1.2rem !important;
    }
    .tool-card {
        padding: 0.5rem !important;
    }
}
