/* Mobile Responsive Styles for GAIYA INTERNAL */

/* Base Mobile Styles */
@media screen and (max-width: 768px) {
    /* Typography */
    body {
        font-size: 14px;
        line-height: 1.6;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    h4 {
        font-size: 1.25rem !important;
    }

    /* Container Padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Navbar Mobile */
    .navbar {
        padding: 0.5rem 1rem !important;
    }

    .navbar-brand {
        font-size: 1.25rem !important;
    }

    .navbar-nav {
        text-align: center;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
    }

    /* Forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Tables */
    .table-responsive {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 15px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0.25rem 0;
    }

    /* Grid System */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Spacing */
    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mt-5 {
        margin-top: 2rem !important;
    }

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

    /* Hero Section */
    .hero-section {
        padding: 3rem 1rem !important;
        min-height: auto !important;
    }

    .hero-title {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Tool Cards */
    .tool-card {
        margin-bottom: 1rem;
    }

    /* Dashboard */
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    /* Admin Panel */
    .admin-card {
        padding: 1rem !important;
    }

    .admin-nav {
        padding: 1rem !important;
    }

    .admin-nav .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin: 0.25rem;
    }

    /* Buy Page */
    .category-package-card {
        margin-bottom: 1rem;
    }

    .package-card {
        margin-bottom: 1rem;
    }

    /* Footer */
    footer {
        padding: 2rem 1rem !important;
        text-align: center;
    }

    footer .row {
        margin-bottom: 1.5rem;
    }

    /* PWA Install Button - Mobile */
    .pwa-install-btn {
        bottom: 16px !important;
        left: 16px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        gap: 8px !important;
        min-width: 130px !important;
        box-shadow: 0 4px 20px rgba(0, 255, 65, 0.5) !important;
    }

    /* Sidebar */
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Floating Elements */
    .floating-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }

    .navbar-brand {
        font-size: 1.1rem !important;
    }

    .pwa-install-btn {
        bottom: 14px !important;
        left: 14px !important;
        padding: 11px 18px !important;
        font-size: 13px !important;
        gap: 7px !important;
        min-width: 120px !important;
        box-shadow: 0 4px 18px rgba(0, 255, 65, 0.5) !important;
    }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .hero-title {
        font-size: 3rem !important;
    }

    .btn {
        width: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn,
    .nav-link,
    .card,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    .card:hover {
        transform: none !important;
    }

    /* Better scrolling */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape Mobile */
@media screen and (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 1rem !important;
        min-height: auto !important;
    }

    .navbar {
        padding: 0.5rem 1rem !important;
    }
}

/* Standalone Mode (PWA) */
.standalone {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.standalone .navbar {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
}

.standalone .pwa-install-btn {
    display: none !important;
}

/* Safe Area Support for Notched Devices */
@supports (padding: max(0px)) {
    .standalone {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 65, 0.2);
    border-top-color: #00ff41;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Menu Improvements */
@media screen and (max-width: 768px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 10px;
        margin-top: 1rem;
        padding: 1rem;
    }

    .navbar-collapse .nav-link {
        border-bottom: 1px solid rgba(0, 255, 65, 0.1);
    }

    .navbar-collapse .nav-link:last-child {
        border-bottom: none;
    }
}

/* Image Optimization */
@media screen and (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .hero-image,
    .feature-image {
        width: 100%;
        height: auto;
    }
}

/* Text Selection */
@media screen and (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(0, 255, 65, 0.2);
    }
}

/* Input Focus on Mobile */
@media screen and (max-width: 768px) {
    input:focus,
    textarea:focus,
    select:focus {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Additional Mobile Improvements for All Pages */

/* Buy Page Specific */
@media screen and (max-width: 768px) {
    .category-nav-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .category-nav-tab {
        flex: 1 1 auto;
        min-width: calc(50% - 0.5rem);
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
    }

    .category-package-card {
        padding: 1rem !important;
    }

    .package-price {
        font-size: 1.5rem !important;
    }

    .tool-card-selector {
        padding: 1rem !important;
    }

    .category-packages-modal {
        padding: 1rem !important;
    }

    .category-packages-content {
        max-width: 100% !important;
        margin: 0.5rem !important;
        padding: 1rem !important;
    }
}

/* Dashboard Specific */
@media screen and (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-value {
        font-size: 1.75rem !important;
    }

    .activity-item {
        padding: 0.75rem !important;
        font-size: 0.9rem;
    }

    .tool-access-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    .achievement-card {
        padding: 1rem !important;
    }
}

/* Admin Panel Specific */
@media screen and (max-width: 768px) {
    .admin-container {
        padding: 0 1rem !important;
    }

    .admin-header h1 {
        font-size: 2rem !important;
    }

    .admin-nav {
        padding: 0.75rem !important;
    }

    .admin-nav .nav-link {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
        margin: 0.25rem 0.125rem !important;
    }

    .admin-card {
        padding: 1rem !important;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.8rem;
    }

    .tool-access-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* Login/Register Specific */
@media screen and (max-width: 768px) {
    .login-card,
    .register-card {
        padding: 1.5rem !important;
        margin: 1rem 0 !important;
        border-radius: 20px !important;
    }

    .card-header h2 {
        font-size: 1.75rem !important;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .social-login-btn {
        width: 100% !important;
        margin-bottom: 0.75rem;
    }
}

/* Blog/FAQ Specific */
@media screen and (max-width: 768px) {
    .blog-card,
    .faq-item {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    .blog-title,
    .faq-question {
        font-size: 1.25rem !important;
    }

    .blog-content,
    .faq-answer {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* Features/About Specific */
@media screen and (max-width: 768px) {
    .feature-card {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1.5rem;
    }

    .feature-icon {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
    }

    .feature-title {
        font-size: 1.5rem !important;
    }

    .hero-section {
        padding: 2rem 1rem !important;
    }
}

/* Navbar Mobile Menu */
@media screen and (max-width: 768px) {
    .navbar-toggler {
        border: 2px solid rgba(0, 255, 65, 0.5);
        padding: 0.5rem 0.75rem;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 255, 65, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 255, 65, 0.2);
    }
}

/* Footer Mobile */
@media screen and (max-width: 768px) {
    footer {
        text-align: center !important;
    }

    footer .row > div {
        margin-bottom: 2rem;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Swal2 Modal Mobile */
@media screen and (max-width: 768px) {
    .swal2-popup {
        width: 90% !important;
        padding: 1.5rem !important;
    }

    .swal2-title {
        font-size: 1.5rem !important;
    }

    .swal2-content {
        font-size: 0.9rem !important;
    }

    .swal2-confirm,
    .swal2-cancel {
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }
}

/* Charts/Graphs Mobile */
@media screen and (max-width: 768px) {
    .chart-container {
        height: 250px !important;
    }

    canvas {
        max-width: 100%;
        height: auto !important;
    }
}

/* Tooltips Mobile */
@media screen and (max-width: 768px) {
    .tooltip {
        font-size: 0.85rem;
        max-width: 200px;
    }
}

/* Badges Mobile */
@media screen and (max-width: 768px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }
}

/* Alerts Mobile */
@media screen and (max-width: 768px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* Dropdowns Mobile */
@media screen and (max-width: 768px) {
    .dropdown-menu {
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Tabs Mobile */
@media screen and (max-width: 768px) {
    .nav-tabs {
        flex-wrap: wrap;
        border-bottom: 2px solid rgba(0, 255, 65, 0.3);
    }

    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        flex: 1 1 auto;
        min-width: calc(50% - 0.5rem);
    }
}

/* Accordion Mobile */
@media screen and (max-width: 768px) {
    .accordion-item {
        margin-bottom: 0.75rem;
    }

    .accordion-button {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    .accordion-body {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

/* Carousel Mobile */
@media screen and (max-width: 768px) {
    .carousel-item {
        padding: 1rem;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }
}

/* Pagination Mobile */
@media screen and (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Breadcrumbs Mobile */
@media screen and (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }

    .breadcrumb-item {
        margin: 0 0.25rem;
    }
}

/* Progress Bars Mobile */
@media screen and (max-width: 768px) {
    .progress {
        height: 1rem;
        font-size: 0.75rem;
    }
}

/* Spinners Mobile */
@media screen and (max-width: 768px) {
    .spinner-border,
    .spinner-grow {
        width: 2rem;
        height: 2rem;
    }
}

/* Utilities Mobile */
@media screen and (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }

    .d-block-mobile {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }
}

/* Landscape Mobile Optimization */
@media screen and (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 1rem !important;
        min-height: auto !important;
    }

    .navbar {
        padding: 0.5rem 1rem !important;
    }

    .login-card,
    .register-card {
        padding: 1.5rem !important;
        margin: 0.5rem 0 !important;
    }
}

/* Very Small Devices (320px and below) */
@media screen and (max-width: 320px) {
    body {
        font-size: 12px;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

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

/* Print Styles */
@media print {
    .navbar,
    .pwa-install-btn,
    .sidebar,
    .floating-sidebar {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* ============================================
   INDEX.EJS SPECIFIC MOBILE IMPROVEMENTS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Hero Section - Index */
    .hero-section {
        padding: 3rem 1rem !important;
        min-height: auto !important;
        text-align: center;
    }

    .hero-title-wrapper {
        margin-bottom: 1.5rem;
    }

    .hero-title-gradient {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.2rem !important;
        margin-bottom: 1rem;
    }

    .hero-desc {
        font-size: 0.9rem !important;
        padding: 0 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .hero-btns {
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100%;
        padding: 0 1rem;
    }

    .hero-btns .btn {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    /* Features Section - Index */
    .features-section {
        padding: 2rem 1rem !important;
    }

    .features-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem;
    }

    .feature-cards {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 1rem;
    }

    .feature-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem;
    }

    .feature-icon {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
    }

    .feature-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem;
    }

    .feature-desc {
        font-size: 0.9rem !important;
        line-height: 1.6;
    }

    /* Stats Section - Index */
    .stats-section {
        padding: 2rem 1rem !important;
    }

    .stats-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 1rem;
    }

    .stat-card {
        padding: 1.5rem !important;
        text-align: center;
    }

    /* Tools Section - Index */
    .tools-section {
        padding: 2rem 1rem !important;
    }

    .tools-section-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem;
    }

    .tool-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
    }

    .tool-header {
        flex-direction: column !important;
        text-align: center;
        margin-bottom: 1rem;
    }

    .tool-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
        margin: 0 auto 1rem;
    }

    .tool-title {
        font-size: 1.5rem !important;
    }

    .tool-image-container {
        margin-bottom: 1rem;
        min-height: auto !important;
    }

    .tool-image {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
    }

    .features-list {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    /* Packages Section - Index */
    .packages-section {
        padding: 2rem 1rem !important;
    }

    .packages-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem;
    }

    .packages-cards {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 1rem;
    }

    .package-card {
        padding: 1.5rem !important;
    }

    .package-price {
        font-size: 2rem !important;
    }

    .package-name {
        font-size: 1.1rem !important;
    }

    .package-features {
        font-size: 0.9rem;
    }

    .package-features li {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }

    /* Key Features Grid - Index */
    .key-features-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 1rem;
    }

    .key-feature-card {
        padding: 1.5rem !important;
    }

    /* Panel Preview - Index */
    .panel-preview-section {
        padding: 2rem 1rem !important;
    }

    .panel-preview-box {
        padding: 1.5rem 1rem !important;
        margin: 0 1rem;
    }

    .panel-preview-stack-text h1 {
        font-size: 1.5rem !important;
    }

    .panel-preview-stack-text p {
        font-size: 0.9rem !important;
    }

    /* Contact Section - Index */
    .contact-section {
        padding: 2rem 1rem !important;
    }

    .contact-link {
        padding: 1.5rem 1rem !important;
        min-height: auto;
        margin-bottom: 1rem;
    }

    /* Floating Sidebar - Index */
    .floating-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        border-radius: 0 !important;
    }

    .sidebar-widget {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    .sidebar-widget-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem;
    }

    /* Social Links - Index */
    .social-item {
        padding: 1rem !important;
        margin-bottom: 0.75rem;
    }

    /* Testimonials - Index */
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 1rem;
    }

    /* Footer - Index */
    footer {
        padding: 2rem 1rem !important;
        text-align: center;
    }

    .footer-content {
        flex-direction: column !important;
        gap: 2rem;
    }

    .footer-section {
        margin-bottom: 2rem;
    }
}

/* ============================================
   DASHBOARD.EJS SPECIFIC MOBILE IMPROVEMENTS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Dashboard Container */
    .dashboard-container {
        padding: 1rem !important;
    }

    /* Sidebar - Dashboard */
    .sidebar {
        width: 85% !important;
        max-width: 320px !important;
        transform: translateX(-100%);
        z-index: 1050;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Sidebar Overlay */
    #sidebarOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
        z-index: 1049;
        display: none;
    }

    .sidebar-header {
        padding: 1.5rem 1rem !important;
    }

    .sidebar-header h3 {
        font-size: 1.25rem !important;
    }

    .sidebar-user {
        padding: 1.25rem 1rem !important;
    }

    .user-avatar {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }

    .user-info h5 {
        font-size: 0.9rem !important;
    }

    .user-info p {
        font-size: 0.75rem !important;
    }

    .sidebar-menu {
        padding: 1rem 0.75rem !important;
    }

    .sidebar-menu-item {
        padding: 0.875rem 1rem !important;
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem;
    }

    .sidebar-menu-item i {
        font-size: 1.1rem !important;
        width: 24px !important;
    }

    /* Main Content - Dashboard */
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
        width: 100% !important;
    }

    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-title {
        font-size: 1.75rem !important;
    }

    .dashboard-subtitle {
        font-size: 0.9rem !important;
    }

    /* Stats Grid - Dashboard */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem !important;
    }

    .stat-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }

    .stat-value {
        font-size: 1.75rem !important;
    }

    .stat-label {
        font-size: 0.85rem !important;
    }

    /* Dashboard Cards */
    .dashboard-card {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem;
    }

    .card-header {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.25rem !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    /* Activity Items - Dashboard */
    .activity-item {
        padding: 1rem !important;
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
    }

    .activity-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }

    /* Tool Access Cards - Dashboard */
    .tool-access-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem;
    }

    .tool-access-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .tool-access-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }

    .tool-access-info h4 {
        font-size: 1.1rem !important;
    }

    .tool-access-info p {
        font-size: 0.85rem !important;
    }

    /* Achievements - Dashboard */
    .achievements-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .achievement-card {
        padding: 1.25rem !important;
    }

    .achievement-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.75rem !important;
    }

    /* Charts - Dashboard */
    .chart-container {
        height: 250px !important;
        margin-bottom: 1rem;
    }

    /* Tables - Dashboard */
    .table-responsive {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.85rem;
    }

    /* Mobile Menu Toggle - Dashboard */
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Show mobile menu toggle on mobile */
    @media screen and (max-width: 768px) {
        .mobile-menu-toggle {
            display: block !important;
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 1051;
            background: rgba(0, 255, 65, 0.2);
            backdrop-filter: blur(10px);
            border: 2px solid rgba(0, 255, 65, 0.4);
            color: #00ff41;
            padding: 0.75rem 1rem;
            border-radius: 10px;
            font-size: 1.25rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
        }

        .mobile-menu-toggle:hover {
            background: rgba(0, 255, 65, 0.3);
            border-color: rgba(0, 255, 65, 0.6);
            transform: scale(1.05);
        }

        .mobile-menu-toggle:active {
            transform: scale(0.95);
        }
    }
}

/* ============================================
   ADMIN.EJS SPECIFIC MOBILE IMPROVEMENTS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Admin Container */
    .admin-container {
        padding: 0 1rem !important;
    }

    /* Admin Header */
    .admin-header {
        margin-bottom: 2rem !important;
        padding: 1rem 0;
    }

    .admin-header h1 {
        font-size: 2rem !important;
        margin-bottom: 0.5rem;
    }

    .admin-header p {
        font-size: 0.9rem !important;
    }

    /* Admin Nav */
    .admin-nav {
        padding: 1rem 0.75rem !important;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .admin-nav .nav {
        flex-wrap: nowrap !important;
        white-space: nowrap;
    }

    .admin-nav .nav-link {
        font-size: 0.85rem !important;
        padding: 0.625rem 1rem !important;
        margin: 0.25rem 0.125rem !important;
        white-space: nowrap;
        min-width: auto;
    }

    .admin-nav .nav-link i {
        font-size: 1rem !important;
        margin-right: 0.5rem;
    }

    /* Mobile Menu Toggle - Admin */
    .mobile-menu-toggle {
        display: none !important;
    }

    @media screen and (max-width: 768px) {
        .mobile-menu-toggle {
            display: block !important;
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 1051;
            background: rgba(0, 255, 65, 0.2);
            backdrop-filter: blur(10px);
            border: 2px solid rgba(0, 255, 65, 0.4);
            color: #00ff41;
            padding: 0.75rem 1rem;
            border-radius: 10px;
            font-size: 1.25rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
        }

        .mobile-menu-toggle:hover {
            background: rgba(0, 255, 65, 0.3);
            border-color: rgba(0, 255, 65, 0.6);
            transform: scale(1.05);
        }

        .mobile-menu-toggle:active {
            transform: scale(0.95);
        }

        /* Admin Nav Mobile Styles */
        .admin-nav {
            position: fixed;
            top: 0;
            left: -100%;
            width: 80%;
            max-width: 300px;
            height: 100vh;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(20px);
            border-right: 2px solid rgba(0, 255, 65, 0.4);
            z-index: 1050;
            transition: left 0.3s ease;
            overflow-y: auto;
            padding: 4rem 1rem 1rem !important;
            box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
        }

        .admin-nav.mobile-active {
            left: 0;
        }

        .admin-nav .nav {
            flex-direction: column !important;
            flex-wrap: wrap !important;
            white-space: normal !important;
        }

        .admin-nav .nav-link {
            width: 100% !important;
            margin: 0.5rem 0 !important;
            padding: 1rem !important;
            text-align: left;
            border-radius: 10px;
        }
    }

    /* Admin Cards */
    .admin-card {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem;
    }

    .admin-card h3 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem;
    }

    /* Stats Cards - Admin */
    .stat-card-admin {
        padding: 1.25rem !important;
        margin-bottom: 1rem;
    }

    .stat-icon-admin {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }

    .stat-value-admin {
        font-size: 1.75rem !important;
    }

    .stat-label-admin {
        font-size: 0.85rem !important;
    }

    /* Tables - Admin */
    .table-responsive {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px; /* Force horizontal scroll on very small screens */
    }

    .table th,
    .table td {
        padding: 0.5rem 0.375rem !important;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .table th {
        font-size: 0.75rem !important;
        font-weight: 700;
    }

    /* Action Buttons - Admin */
    .btn-admin {
        padding: 0.625rem 1rem !important;
        font-size: 0.85rem !important;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn-admin {
        width: auto;
    }

    .tool-access-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }

    /* Filters - Admin */
    .filter-section {
        flex-direction: column !important;
        gap: 1rem;
    }

    .filter-section .col-md-3,
    .filter-section .col-md-6 {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .form-control,
    .search-box {
        width: 100% !important;
        font-size: 0.9rem;
    }

    /* Bulk Actions - Admin */
    .bulk-actions-bar {
        flex-direction: column !important;
        gap: 1rem;
        padding: 1rem !important;
    }

    .bulk-actions-bar select,
    .bulk-actions-bar button {
        width: 100% !important;
    }

    /* Tool Cards Grid - Admin */
    .tools-grid,
    .access-tools-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .tool-card-admin {
        padding: 1.25rem !important;
    }

    /* Modals - Admin */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-content {
        border-radius: 15px !important;
    }

    .modal-header {
        padding: 1rem !important;
    }

    .modal-header h5 {
        font-size: 1.25rem !important;
    }

    .modal-body {
        padding: 1rem !important;
        font-size: 0.9rem;
    }

    .modal-footer {
        padding: 1rem !important;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }

    /* Forms - Admin */
    .form-label {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem !important;
        padding: 0.75rem !important;
    }

    /* Tabs - Admin */
    .tab-content {
        padding: 1rem 0 !important;
    }

    /* Charts - Admin */
    .chart-container {
        height: 250px !important;
        margin-bottom: 1rem;
    }

    /* User Cards - Admin */
    .user-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    /* Access Control - Admin */
    .access-tools-grid {
        grid-template-columns: 1fr !important;
    }

    .access-tool-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem;
    }

    /* Tool Access Toggle - Admin */
    .tool-access-toggle-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .tool-access-status-text {
        min-width: auto !important;
        width: 100%;
    }
}

/* Very Small Mobile Devices - All Pages */
@media screen and (max-width: 480px) {
    /* Index */
    .hero-title-gradient {
        font-size: 1.75rem !important;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .package-card {
        padding: 1.25rem !important;
    }

    /* Dashboard */
    .dashboard-title {
        font-size: 1.5rem !important;
    }

    .stat-value {
        font-size: 1.5rem !important;
    }

    /* Admin */
    .admin-header h1 {
        font-size: 1.75rem !important;
    }

    .admin-card h3 {
        font-size: 1.25rem !important;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.375rem 0.25rem !important;
        font-size: 0.75rem;
    }
}

