/**
 * MobiFirms - Main Stylesheet
 * 
 * @package MobiFirms
 * @author Senior PHP Architect
 */

/* ============================================
   Variables - Purple-Blue Gradient Theme
   ============================================ */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --secondary-dark: #5a3780;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --light-bg: #ffffff;
    --dark-color: #212529;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --border-color: #dee2e6;
    --border-radius: 1rem;
    --transition: all 0.3s ease;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 20px 40px rgba(0,0,0,0.15);
}

/* ============================================
   Global Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f8f9fa;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1, .h1 {
    font-size: 2.5rem;
}

h2, .h2 {
    font-size: 2rem;
}

h3, .h3 {
    font-size: 1.75rem;
}

h4, .h4 {
    font-size: 1.5rem;
}

h5, .h5 {
    font-size: 1.25rem;
}

h6, .h6 {
    font-size: 1rem;
}

/* ============================================
   Detail Pages Professional Typography
   ============================================ */

/* Detail Page Headings - More Compact & Professional */
.detail-page h1,
.blog-post h1,
.firmware-detail h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.detail-page h2,
.blog-post h2,
.firmware-detail h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.detail-page h3,
.blog-post h3,
.firmware-detail h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.detail-page h4,
.blog-post h4,
.firmware-detail h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.detail-page h5,
.blog-post h5,
.firmware-detail h5 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.detail-page h6,
.blog-post h6,
.firmware-detail h6 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Detail Page Body Text */
.detail-page,
.blog-post,
.firmware-detail {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

/* Card Headers in Detail Pages */
.detail-page .card-header,
.blog-post .card-header,
.firmware-detail .card-header {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

/* Reduced spacing between sections in detail pages */
.detail-page .card,
.blog-post .card,
.firmware-detail .card {
    margin-bottom: 1rem;
}

/* Professional spacing variables for detail pages */
.detail-spacing-tight {
    margin-bottom: 0.5rem;
}

.detail-spacing-normal {
    margin-bottom: 1rem;
}

.detail-spacing-relaxed {
    margin-bottom: 1.5rem;
}

p {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    transition: var(--transition);
    color: var(--primary-dark);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-muted);
}

strong, b {
    font-weight: 700;
    color: var(--text-dark);
}

small, .small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.shadow-custom {
    box-shadow: var(--box-shadow);
}

.hover-lift {
    transition: all 0.3s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* Override hover-lift for brand cards */
.brand-card .hover-lift:hover {
    background: #7c8bf5 !important;
    box-shadow: 0 20px 40px rgba(124, 139, 245, 0.4) !important;
}

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    padding: 0.75rem 0;
    /* Fallback solid color */
    background: #667eea !important;
    /* Gradient overlay */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ensure navbar stays styled on all Bootstrap variants */
.navbar-dark,
.navbar.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff !important;
    transition: var(--transition);
}

.navbar-brand img {
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.5)) 
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
    transition: var(--transition);
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-brand:hover img {
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.7)) 
            drop-shadow(0 0 25px rgba(255, 255, 255, 0.5));
    transform: translateY(-2px);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    color: rgba(255,255,255,0.9) !important;
}

.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,0.15);
    border-radius: 0.5rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border-radius: 1rem;
    transition: all 0.3s ease;
    border: none;
    background: var(--light-bg);
    box-shadow: var(--box-shadow);
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
    background: #f8f9fa;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.card-body {
    color: var(--text-dark);
}

.card-title {
    color: var(--text-dark);
    font-weight: 600;
}

.card-text {
    color: var(--text-muted);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #5a3780 100%);
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary i {
    color: #ffffff !important;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    border-radius: 5px;
    border: 2px solid #e0e0e0;
    padding: 0.625rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: 5px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
}

/* ============================================
   Pagination
   ============================================ */
.pagination .page-link {
    border-radius: 5px;
    margin: 0 0.25rem;
    border: 2px solid var(--border-color);
    color: var(--primary-dark);
    background: var(--light-bg);
    font-weight: 600;
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-light);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    border-color: transparent;
    color: var(--text-light);
}

.pagination .page-item.disabled .page-link {
    background: #f8f9fa;
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: auto;
    background: #212529 !important;
    background: linear-gradient(180deg, #2c3e50 0%, #212529 100%) !important;
    color: #f8f9fa;
    border-top: 3px solid #667eea;
}

.footer h5 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer a:hover {
    color: #ffffff !important;
    transform: translateX(5px);
    opacity: 1;
}

.footer .text-white-50 {
    color: rgba(255, 255, 255, 0.6) !important;
}

.footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.footer .social-links a:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.footer .border-secondary {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

.footer .footer-logo {
    max-height: 60px;
    width: auto;
    display: block;
    filter: brightness(1.1) 
            drop-shadow(0 2px 10px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
    transition: var(--transition);
}

.footer .footer-logo:hover {
    filter: brightness(1.3) 
            drop-shadow(0 4px 15px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.6));
    transform: scale(1.05) translateY(-2px);
}

.footer h6 {
    color: #ffffff !important;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================
   Scroll to Top Button
   ============================================ */
#scrollTopBtn {
    transition: var(--transition);
}

#scrollTopBtn:hover {
    transform: translateY(-5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary) !important;
    min-height: 400px;
}

.hero-section h1,
.hero-section .display-4 {
    color: var(--text-light) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
}

.hero-section p,
.hero-section .lead {
    color: rgba(255,255,255,0.95) !important;
    font-size: 1.1rem;
}

.hero-section .search-box {
    max-width: 600px;
}

.hero-section .search-box input {
    height: 60px;
    font-size: 1.1rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: var(--light-bg);
    color: var(--text-dark);
}

.hero-section .search-box input::placeholder {
    color: var(--text-muted);
}

.hero-section .btn-light {
    background: var(--light-bg);
    color: var(--primary-dark);
    border: none;
    font-weight: 600;
}

.hero-section .btn-light:hover {
    background: #e9ecef;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.hero-section .btn-outline-light {
    border: 2px solid var(--text-light);
    color: var(--text-light);
    font-weight: 600;
}

.hero-section .btn-outline-light:hover {
    background: var(--text-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   Brand Cards
   ============================================ */
.brands-section {
    background: var(--gradient-secondary) !important;
}

.brands-section h2 {
    color: var(--text-dark);
}

.brand-card .card {
    transition: var(--transition);
    cursor: pointer;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
}

.brand-card .card h6 {
    color: var(--text-dark);
    font-weight: 600;
}

.brand-card .card small {
    color: var(--text-muted);
}

.brand-card .card:hover {
    background: #7c8bf5 !important;
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(124, 139, 245, 0.4) !important;
}

.brand-card .card:hover h6 {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-card .card:hover small {
    color: #ffffff !important;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.brand-card .card:hover i {
    color: #ffffff !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-card .card:hover .bg-light {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
}

.brand-card .card:hover .bg-primary-subtle,
.brand-card .card:hover .bg-primary {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
}

.brand-card .card:hover .bg-primary-opacity-10,
.brand-card .card:hover .bg-opacity-10 {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
}

/* ============================================
   Firmware Cards
   ============================================ */
.firmware-card {
    transition: var(--transition);
    background: var(--light-bg);
    border: 1px solid var(--border-color);
}

.firmware-card .card-title {
    color: var(--text-dark);
    font-weight: 600;
}

.firmware-card .card-text {
    color: var(--text-muted);
}

.firmware-card .badge {
    font-weight: 600;
}

.firmware-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

/* ============================================
   Statistics Cards - Single Row Responsive
   ============================================ */
.stats-section {
    background: var(--light-color) !important;
}

/* Wrapper to handle overflow on very small screens */
.stats-row-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.stats-row-wrapper::-webkit-scrollbar {
    height: 6px;
}

.stats-row-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.stats-row-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.stats-row-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Flexbox row that never wraps */
.stats-row {
    display: flex;
    gap: 20px;
    min-width: min-content;
}

/* Each card wrapper - equal flex basis */
.stat-card-wrapper {
    flex: 1 1 0;
    min-width: 200px;
}

.stat-card {
    transition: var(--transition);
    background: var(--light-bg) !important;
    border: 1px solid var(--border-color);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

/* Icon sizing */
.stat-icon {
    font-size: 48px;
    opacity: 0.8;
}

/* Number sizing */
.stat-number {
    font-size: 2.5rem;
}

/* Label sizing */
.stat-label {
    font-size: 1rem;
    font-weight: 600;
}

.stat-card i {
    transition: var(--transition);
}

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

/* ============================================
   Responsive Adjustments - Keep Single Row
   ============================================ */

/* Large tablets and below (992px) */
@media (max-width: 992px) {
    .stats-row {
        gap: 15px;
    }
    
    .stat-card-wrapper {
        min-width: 180px;
    }
    
    .stat-icon {
        font-size: 40px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .stats-row {
        gap: 12px;
    }
    
    .stat-card-wrapper {
        min-width: 160px;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-icon {
        font-size: 36px;
        margin-bottom: 0.5rem !important;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
}

/* Small mobile (576px) */
@media (max-width: 576px) {
    .stats-row {
        gap: 10px;
    }
    
    .stat-card-wrapper {
        min-width: 140px;
    }
    
    .stat-card {
        padding: 0.75rem !important;
    }
    
    .stat-icon {
        font-size: 32px;
        margin-bottom: 0.5rem !important;
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0.25rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem;
        margin-bottom: 0 !important;
    }
}

/* Extra small mobile (400px and below) */
@media (max-width: 400px) {
    .stats-row {
        gap: 8px;
    }
    
    .stat-card-wrapper {
        min-width: 120px;
    }
    
    .stat-card {
        padding: 0.6rem !important;
    }
    
    .stat-icon {
        font-size: 28px;
        margin-bottom: 0.4rem !important;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

/* ============================================
   Feature Cards - Single Row Responsive
   ============================================ */

/* Wrapper to handle overflow on small screens */
.features-row-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.features-row-wrapper::-webkit-scrollbar {
    height: 6px;
}

.features-row-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.features-row-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.features-row-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Flexbox row that never wraps */
.features-row {
    display: flex;
    gap: 20px;
    min-width: min-content;
}

/* Each card wrapper - equal flex basis */
.feature-card-wrapper {
    flex: 1 1 0;
    min-width: 250px;
}

.feature-card {
    transition: var(--transition);
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

/* Icon circle */
.feature-icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

/* Icon sizing */
.feature-icon {
    font-size: 36px;
}

/* Title sizing */
.feature-title {
    font-size: 1.3rem;
}

/* Text sizing */
.feature-text {
    font-size: 1rem;
    line-height: 1.5;
}

.feature-card i {
    transition: var(--transition);
}

.feature-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   Feature Cards Responsive Adjustments
   ============================================ */

/* Large tablets and below (992px) */
@media (max-width: 992px) {
    .features-row {
        gap: 15px;
    }
    
    .feature-card-wrapper {
        min-width: 220px;
    }
    
    .feature-card {
        padding: 1.25rem !important;
    }
    
    .feature-icon-circle {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon {
        font-size: 32px;
    }
    
    .feature-title {
        font-size: 1.2rem;
    }
    
    .feature-text {
        font-size: 0.95rem;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .features-row {
        gap: 12px;
    }
    
    .feature-card-wrapper {
        min-width: 200px;
    }
    
    .feature-card {
        padding: 1rem !important;
    }
    
    .feature-icon-circle {
        width: 60px;
        height: 60px;
        margin-bottom: 0.75rem !important;
    }
    
    .feature-icon {
        font-size: 28px;
    }
    
    .feature-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-text {
        font-size: 0.9rem;
    }
}

/* Small mobile (576px) */
@media (max-width: 576px) {
    .features-row {
        gap: 10px;
    }
    
    .feature-card-wrapper {
        min-width: 180px;
    }
    
    .feature-card {
        padding: 0.875rem !important;
    }
    
    .feature-icon-circle {
        width: 55px;
        height: 55px;
        margin-bottom: 0.6rem !important;
    }
    
    .feature-icon {
        font-size: 24px;
    }
    
    .feature-title {
        font-size: 1rem;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

/* Extra small mobile (400px and below) */
@media (max-width: 400px) {
    .features-row {
        gap: 8px;
    }
    
    .feature-card-wrapper {
        min-width: 160px;
    }
    
    .feature-card {
        padding: 0.75rem !important;
    }
    
    .feature-icon-circle {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-icon {
        font-size: 22px;
    }
    
    .feature-title {
        font-size: 0.95rem;
        margin-bottom: 0.4rem !important;
    }
    
    .feature-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* ============================================
   Content Tickers - Scrolling News/Files
   ============================================ */

/* Ticker wrapper - Main container */
.ticker-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Different styles for each ticker */
.ticker-latest {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ticker-top {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Content wrapper */
.ticker-content {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Items container */
.ticker-items {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
    gap: 40px;
}

/* Reverse direction for second ticker */
.ticker-reverse {
    animation: ticker-scroll-reverse 60s linear infinite;
}

/* Each ticker item */
.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ticker-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Ticker item icon */
.ticker-item i {
    flex-shrink: 0;
}

/* Ticker text (file name) */
.ticker-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ticker meta info (category/downloads) */
.ticker-meta {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    opacity: 0.8;
}

/* Ticker label (Latest Uploads / Top Files) */
.ticker-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
    white-space: nowrap;
}

.ticker-label-right {
    right: 20px;
}

/* Pause animation on hover */
.ticker-wrapper:hover .ticker-items {
    animation-play-state: paused;
}

/* Keyframe animations */
@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes ticker-scroll-reverse {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* ============================================
   Ticker Responsive Adjustments
   ============================================ */

/* Large tablets and below (992px) */
@media (max-width: 992px) {
    .ticker-wrapper {
        padding: 10px 0;
    }
    
    .ticker-item {
        padding: 5px 16px;
        font-size: 13px;
    }
    
    .ticker-text {
        max-width: 250px;
    }
    
    .ticker-label {
        padding: 6px 16px;
        font-size: 12px;
        right: 15px;
    }
    
    .ticker-items {
        gap: 30px;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .ticker-wrapper {
        padding: 8px 0;
    }
    
    .ticker-item {
        padding: 4px 12px;
        font-size: 12px;
        border-radius: 15px;
    }
    
    .ticker-text {
        max-width: 200px;
    }
    
    .ticker-meta {
        margin-left: 8px;
        padding-left: 8px;
        font-size: 11px;
    }
    
    .ticker-label {
        padding: 5px 12px;
        font-size: 11px;
        right: 10px;
    }
    
    .ticker-items {
        gap: 25px;
    }
}

/* Small mobile (576px) */
@media (max-width: 576px) {
    .ticker-wrapper {
        padding: 6px 0;
    }
    
    .ticker-item {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 12px;
    }
    
    .ticker-text {
        max-width: 150px;
    }
    
    .ticker-meta {
        display: none; /* Hide meta on very small screens */
    }
    
    .ticker-label {
        padding: 4px 10px;
        font-size: 10px;
        right: 8px;
    }
    
    .ticker-items {
        gap: 20px;
    }
    
    /* Faster animation on mobile for better UX */
    .ticker-items {
        animation-duration: 40s;
    }
    
    .ticker-reverse {
        animation-duration: 40s;
    }
}

/* Extra small mobile (400px and below) */
@media (max-width: 400px) {
    .ticker-wrapper {
        padding: 5px 0;
    }
    
    .ticker-item {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .ticker-text {
        max-width: 120px;
    }
    
    .ticker-label {
        padding: 3px 8px;
        font-size: 9px;
        right: 5px;
    }
    
    .ticker-items {
        gap: 15px;
        animation-duration: 35s;
    }
    
    .ticker-reverse {
        animation-duration: 35s;
    }
}

/* ============================================
   Section Backgrounds
   ============================================ */
.section-light {
    background: var(--light-bg);
}

.section-gray {
    background: #f8f9fa;
}

.section-gradient {
    background: var(--gradient-primary);
    color: var(--text-light);
}

.section-gradient h1,
.section-gradient h2,
.section-gradient h3,
.section-gradient h4,
.section-gradient h5,
.section-gradient h6 {
    color: var(--text-light);
}

.section-gradient p {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Text Utilities
   ============================================ */
.text-primary-dark {
    color: var(--primary-dark) !important;
}

.text-secondary-dark {
    color: var(--secondary-dark) !important;
}

.text-dark-custom {
    color: var(--text-dark) !important;
}

.text-muted-custom {
    color: var(--text-muted) !important;
}

.text-light-custom {
    color: var(--text-light) !important;
}

/* ============================================
   Background Utilities
   ============================================ */
.bg-light-custom {
    background: var(--light-bg) !important;
}

.bg-primary-gradient {
    background: var(--gradient-primary) !important;
}

.bg-dark-custom {
    background: var(--dark-color) !important;
    color: var(--text-light) !important;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    background-color: transparent;
    padding: 1rem 0;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 600;
}

.breadcrumb-item a {
    color: var(--primary-dark);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar .card {
    margin-bottom: 1.25rem;
    background: var(--light-bg);
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: 1rem;
}

.sidebar .card-header {
    background: var(--gradient-primary);
    color: var(--text-light);
    font-weight: 600;
    border: none;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 0.875rem 1.25rem;
}

.sidebar .list-group-item {
    border-left: 3px solid transparent;
    transition: var(--transition);
    color: var(--text-dark);
    background: var(--light-bg);
}

.sidebar .list-group-item:hover {
    border-left-color: var(--primary-dark);
    background-color: rgba(61, 77, 183, 0.05);
    color: var(--primary-dark);
}

.sidebar .list-group-item a {
    color: var(--text-dark);
    text-decoration: none;
}

.sidebar .list-group-item:hover a {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ============================================
   Download Button
   ============================================ */
.download-btn {
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.3);
    transition: var(--transition);
}

.download-btn:hover::before {
    left: 100%;
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner-border-custom {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        min-height: 350px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .search-box input {
        height: 50px;
        font-size: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 300px;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .footer,
    .sidebar,
    #scrollTopBtn,
    .btn,
    .adsbygoogle {
        display: none !important;
    }
}

/* ============================================
   Additional Utilities
   ============================================ */
.rounded-4 {
    border-radius: 1rem !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.p-5 {
    padding: 2rem !important;
}

.mb-5 {
    margin-bottom: 2.5rem !important;
}

.hover-text-primary:hover {
    color: var(--primary-color) !important;
}

/* Section Spacing Optimization */
section {
    padding: 3rem 0;
}

.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Card Body Padding Reduction */
.card-body {
    padding: 1.25rem;
}

.card-header {
    padding: 0.875rem 1.25rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   TICKER STYLES (Latest Uploads / Top Files)
   ============================================ */

/* Ticker wrapper - Main container */
.ticker-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: transparent;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Different styles for each ticker */
.ticker-latest {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ticker-top {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Content wrapper */
.ticker-content {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Items container */
.ticker-items {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 80s linear infinite;
    gap: 20px;
}

/* Reverse direction for second ticker */
.ticker-reverse {
    animation: ticker-scroll-reverse 80s linear infinite;
}

/* Each ticker item */
.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.ticker-item:hover {
    background: rgba(102, 126, 234, 0.4);
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

/* Ticker item icon */
.ticker-item i {
    flex-shrink: 0;
}

/* Ticker text (file name) */
.ticker-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ticker meta info (category/downloads) */
.ticker-meta {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(102, 126, 234, 0.4);
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* Ticker label (Latest Uploads / Top Files) */
.ticker-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ticker-label-right {
    right: 20px;
}

/* Pause animation on hover */
.ticker-wrapper:hover .ticker-items {
    animation-play-state: paused;
}

/* Keyframe animations */
@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes ticker-scroll-reverse {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* ============================================
   TICKER RESPONSIVE STYLES
   ============================================ */

/* Large tablets and below (992px) */
@media (max-width: 992px) {
    .ticker-wrapper {
        padding: 10px 0;
    }
    
    .ticker-item {
        padding: 5px 16px;
        font-size: 13px;
    }
    
    .ticker-text {
        max-width: 250px;
    }
    
    .ticker-label {
        padding: 6px 16px;
        font-size: 12px;
        right: 15px;
    }
    
    .ticker-items {
        gap: 30px;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .ticker-wrapper {
        padding: 8px 0;
    }
    
    .ticker-item {
        padding: 4px 12px;
        font-size: 12px;
        border-radius: 15px;
    }
    
    .ticker-text {
        max-width: 200px;
    }
    
    .ticker-meta {
        margin-left: 8px;
        padding-left: 8px;
        font-size: 11px;
    }
    
    .ticker-label {
        padding: 5px 12px;
        font-size: 11px;
        right: 10px;
    }
    
    .ticker-items {
        gap: 25px;
    }
}

/* Small mobile (576px) */
@media (max-width: 576px) {
    .ticker-wrapper {
        padding: 6px 0;
    }
    
    .ticker-item {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 12px;
    }
    
    .ticker-text {
        max-width: 150px;
    }
    
    .ticker-meta {
        display: none; /* Hide meta on very small screens */
    }
    
    .ticker-label {
        padding: 4px 10px;
        font-size: 10px;
        right: 8px;
    }
    
    .ticker-items {
        gap: 20px;
    }
    
    /* Faster animation on mobile for better UX */
    .ticker-items {
        animation-duration: 40s;
    }
    
    .ticker-reverse {
        animation-duration: 40s;
    }
}

/* Extra small mobile (400px and below) */
@media (max-width: 400px) {
    .ticker-wrapper {
        padding: 5px 0;
    }
    
    .ticker-item {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .ticker-text {
        max-width: 120px;
    }
    
    .ticker-label {
        padding: 3px 8px;
        font-size: 9px;
        right: 5px;
    }
    
    .ticker-items {
        gap: 15px;
        animation-duration: 35s;
    }
    
    .ticker-reverse {
        animation-duration: 35s;
    }
}
