/**
 * ADVANCED PREMIUM DESIGN - ULTRA RESPONSIVE
 * Perfect for all devices - Phone, Tablet, PC
 * এখন আরও সুন্দর এবং advanced!
 */

/* ==========================================
   ADVANCED RESPONSIVE BREAKPOINTS
   ========================================== */
:root {
    /* Ultra-fine responsive controls */
    --container-mobile: 100%;
    --container-tablet: 720px;
    --container-desktop: 960px;
    --container-wide: 1140px;
    --container-ultra: 1320px;

    /* Advanced spacing system */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Advanced font sizing (fluid) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.25rem);
    --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 3rem);
    --text-5xl: clamp(3rem, 2.25rem + 3.75vw, 3.75rem);

    /* Advanced gradients with animation support */
    --gradient-animated-1: linear-gradient(270deg, #667eea, #764ba2, #667eea);
    --gradient-animated-2: linear-gradient(270deg, #f093fb, #f5576c, #f093fb);
    --gradient-animated-3: linear-gradient(270deg, #4facfe, #00f2fe, #4facfe);

    /* Advanced glass effects */
    --glass-ultra: rgba(255, 255, 255, 0.1);
    --glass-strong: rgba(255, 255, 255, 0.25);
    --glass-subtle: rgba(255, 255, 255, 0.05);

    /* Advanced shadows with multiple layers */
    --shadow-premium:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 16px 32px rgba(0, 0, 0, 0.1),
        0 32px 64px rgba(0, 0, 0, 0.1);

    --shadow-float:
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 24px 48px rgba(102, 126, 234, 0.15);

    /* Mobile-first touch targets */
    --touch-target: 44px;
    --touch-target-large: 56px;
}

/* ==========================================
   ADVANCED ANIMATED GRADIENTS
   ========================================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: var(--gradient-animated-1);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

.gradient-animated-fast {
    background: var(--gradient-animated-2);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* ==========================================
   ULTRA RESPONSIVE CONTAINER SYSTEM
   ========================================== */
.container-fluid-responsive {
    width: 100%;
    padding-right: var(--space-md);
    padding-left: var(--space-md);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container-fluid-responsive {
        max-width: var(--container-mobile);
        padding-right: var(--space-lg);
        padding-left: var(--space-lg);
    }
}

@media (min-width: 768px) {
    .container-fluid-responsive {
        max-width: var(--container-tablet);
        padding-right: var(--space-xl);
        padding-left: var(--space-xl);
    }
}

@media (min-width: 992px) {
    .container-fluid-responsive {
        max-width: var(--container-desktop);
    }
}

@media (min-width: 1200px) {
    .container-fluid-responsive {
        max-width: var(--container-wide);
    }
}

@media (min-width: 1400px) {
    .container-fluid-responsive {
        max-width: var(--container-ultra);
    }
}

/* ==========================================
   ADVANCED MOBILE OPTIMIZATIONS
   ========================================== */
@media (max-width: 768px) {

    /* Improve touch targets on mobile */
    .btn,
    button,
    a.btn,
    input[type="submit"],
    input[type="button"] {
        min-height: var(--touch-target);
        padding: 0.75rem 1.5rem;
        font-size: var(--text-base);
    }

    /* Mobile-friendly spacing */
    section#header {
        padding: 0.75rem 0;
    }

    section#home-banner {
        padding: 3rem 0;
    }

    section#home-banner h2 {
        font-size: var(--text-3xl);
        line-height: 1.2;
        padding: 0 1rem;
    }

    /* Stack navigation items */
    section#header .top-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    section#header .top-nav li {
        width: 100%;
    }

    section#header .top-nav li a {
        display: block;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    /* Mobile-friendly forms */
    .form-control {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 1rem 1.25rem;
    }

    /* Mobile-optimized cards */
    .panel,
    .glass-container,
    .product-card {
        margin-bottom: 1rem;
    }

    /* Better mobile grid */
    .home-shortcuts ul {
        gap: 0.75rem;
    }

    .home-shortcuts li {
        padding: 1.5rem;
    }

    /* Mobile table scroll */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile modal */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: var(--radius-lg);
    }
}

/* ==========================================
   TABLET OPTIMIZATIONS (768px - 992px)
   ========================================== */
@media (min-width: 768px) and (max-width: 992px) {
    .home-shortcuts ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    section#home-banner h2 {
        font-size: var(--text-4xl);
    }
}

/* ==========================================
   DESKTOP ENHANCEMENTS (> 992px)
   ========================================== */
@media (min-width: 992px) {

    /* Desktop-specific hover effects */
    .hover-3d {
        transition: all var(--transition-base);
        transform-style: preserve-3d;
    }

    .hover-3d:hover {
        transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-10px);
    }

    /* Parallax effects */
    .parallax-container {
        perspective: 1000px;
    }

    /* Desktop grid enhancements */
    .home-shortcuts ul {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Desktop navigation */
    .navbar-main .navbar-nav>li {
        position: relative;
    }
}

/* ==========================================
   ULTRA WIDE SCREENS (> 1400px)
   ========================================== */
@media (min-width: 1400px) {
    section#home-banner h2 {
        font-size: var(--text-5xl);
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   ADVANCED CARD SYSTEM
   ========================================== */
.premium-card {
    background: var(--glass-white);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-premium);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.05) 0%,
            rgba(118, 75, 162, 0.05) 50%,
            rgba(240, 147, 251, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.premium-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-float);
    border-color: rgba(255, 255, 255, 0.3);
}

.premium-card:hover::before {
    opacity: 1;
}

/* ==========================================
   ADVANCED BUTTON SYSTEM
   ========================================== */
.btn-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-premium:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-premium:hover::before {
    width: 400px;
    height: 400px;
}

.btn-premium:active {
    transform: translateY(-1px) scale(1.02);
}

/* Icon in button */
.btn-premium i {
    font-size: 1.125rem;
}

/* ==========================================
   ADVANCED FORM SYSTEM
   ========================================== */
.form-premium {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group-premium {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-control-premium {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
}

.form-control-premium:focus {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-control-premium::placeholder {
    color: var(--color-gray-400);
    transition: all var(--transition-base);
}

.form-control-premium:focus::placeholder {
    opacity: 0.5;
    transform: translateX(5px);
}

/* Floating label advanced */
.form-floating-premium {
    position: relative;
}

.form-floating-premium label {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    background: white;
    padding: 0 0.5rem;
    color: var(--color-gray-500);
    font-size: var(--text-base);
    font-weight: 500;
    pointer-events: none;
    transition: all var(--transition-base);
}

.form-floating-premium input:focus+label,
.form-floating-premium input:not(:placeholder-shown)+label {
    top: 0;
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: 600;
}

/* ==========================================
   ADVANCED GRID SYSTEM
   ========================================== */
.grid-responsive {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-xl);
    }
}

@media (min-width: 992px) {
    .grid-responsive {
        gap: var(--space-2xl);
    }
}

/* ==========================================
   ADVANCED ANIMATIONS
   ========================================== */
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideRight {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-float-up {
    animation: floatUp 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-slide-right {
    animation: slideRight 0.6s ease-out forwards;
}

/* Stagger animations */
.stagger-children>* {
    opacity: 0;
}

.stagger-children.active>*:nth-child(1) {
    animation: floatUp 0.6s ease-out 0.1s forwards;
}

.stagger-children.active>*:nth-child(2) {
    animation: floatUp 0.6s ease-out 0.2s forwards;
}

.stagger-children.active>*:nth-child(3) {
    animation: floatUp 0.6s ease-out 0.3s forwards;
}

.stagger-children.active>*:nth-child(4) {
    animation: floatUp 0.6s ease-out 0.4s forwards;
}

.stagger-children.active>*:nth-child(5) {
    animation: floatUp 0.6s ease-out 0.5s forwards;
}

.stagger-children.active>*:nth-child(6) {
    animation: floatUp 0.6s ease-out 0.6s forwards;
}

/* ==========================================
   ADVANCED TYPOGRAPHY
   ========================================== */
.text-responsive {
    font-size: var(--text-base);
}

.heading-responsive {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}

.heading-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* ==========================================
   ADVANCED NAVBAR (Mobile-First)
   ========================================== */
.navbar-premium {
    background: var(--glass-white);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar-menu {
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
}

.navbar-menu.active {
    display: flex;
}

.navbar-item {
    padding: var(--space-md);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: 500;
}

.navbar-item:hover {
    background: var(--glass-white);
    transform: translateX(5px);
}

@media (min-width: 992px) {
    .navbar-menu {
        display: flex;
        flex-direction: row;
        gap: var(--space-lg);
        padding: 0;
    }

    .navbar-item:hover {
        transform: translateY(-2px);
    }
}

/* ==========================================
   ADVANCED SPACING UTILITIES
   ========================================== */
.p-responsive {
    padding: var(--space-md);
}

.px-responsive {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.py-responsive {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.m-responsive {
    margin: var(--space-md);
}

.mx-responsive {
    margin-left: var(--space-md);
    margin-right: var(--space-md);
}

.my-responsive {
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .p-responsive {
        padding: var(--space-lg);
    }

    .px-responsive {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }

    .py-responsive {
        padding-top: var(--space-lg);
        padding-bottom: var(--space-lg);
    }

    .m-responsive {
        margin: var(--space-lg);
    }

    .mx-responsive {
        margin-left: var(--space-lg);
        margin-right: var(--space-lg);
    }

    .my-responsive {
        margin-top: var(--space-lg);
        margin-bottom: var(--space-lg);
    }
}

@media (min-width: 992px) {
    .p-responsive {
        padding: var(--space-xl);
    }

    .px-responsive {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }

    .py-responsive {
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }

    .m-responsive {
        margin: var(--space-xl);
    }

    .mx-responsive {
        margin-left: var(--space-xl);
        margin-right: var(--space-xl);
    }

    .my-responsive {
        margin-top: var(--space-xl);
        margin-bottom: var(--space-xl);
    }
}

/* ==========================================
   PRINT OPTIMIZATIONS
   ========================================== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .btn,
    .navbar,
    .back-to-top,
    .toast {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 2cm;
    }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   DARK MODE SUPPORT
   ========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-100: #1f2937;
        --color-gray-200: #374151;
        --color-light: #1f2937;
    }

    .form-control-premium {
        background: rgba(31, 41, 55, 0.9);
        color: white;
        border-color: #374151;
    }

    .form-control-premium:focus {
        background: #1f2937;
    }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Force GPU acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}