/* responsive.css - Complete Mobile Responsive CSS */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --dark: #0f172a;
    --darker: #020617;
    --card: #1e293b;
    --text: #f8fafc;
    --text-light: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #334155;
}

/* Base Mobile First Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--dark);
    color: var(--text);
    overflow-x: hidden;
}

/* Container fixes */
.container {
    width: 100%;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Typography fixes */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Navigation fixes */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text) !important;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

/* Mobile menu fixes */
.mobile-menu-btn {
    display: none !important;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1060;
    background: var(--primary) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

/* Sidebar fixes */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1050;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.sidebar.show {
    right: 0 !important;
}

/* Main content fixes */
.main-content {
    min-height: 100vh;
    background: transparent;
}

/* Card fixes */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.glass-card {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    color: var(--text);
}

/* Button fixes */
.btn {
    border: none;
    border-radius: 12px;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-search, .btn-bomb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-search:hover, .btn-bomb:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

/* Form fixes */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.search-input-container {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 15px;
    transition: all 0.3s ease;
    padding: 1rem;
}

.search-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Result container fixes */
.result-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Alert fixes */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-left: 4px solid #3b82f6;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-left: 4px solid #10b981;
}

/* Badge fixes */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.badge-found {
    background: var(--success);
}

.badge-not-found {
    background: var(--text-light);
}

.badge-vip {
    background: linear-gradient(135deg, var(--warning), #e69500);
    color: #000;
}

/* Stats card fixes */
.stats-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
    text-align: center;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Feature card fixes */
.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    border: none;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Welcome card fixes */
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Image fixes */
img {
    max-width: 100%;
    height: auto;
}

/* Table fixes */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text);
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Progress bar fixes */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

/* Loading spinner fixes */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Mobile First Breakpoints */
@media (max-width: 576px) {
    /* Extra small devices */
    body {
        font-size: 13px !important;
        padding-top: 60px !important;
    }
    
    .container {
        padding: 0 10px !important;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .card, .glass-card {
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }
    
    .btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
    
    .welcome-card {
        padding: 1.5rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 768px) {
    /* Small devices */
    body {
        font-size: 14px !important;
        padding-top: 70px !important;
    }
    
    .container {
        padding: 0 15px !important;
    }
    
    /* Mobile menu activation */
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .sidebar {
        right: -100% !important;
    }
    
    .sidebar.show {
        right: 0 !important;
    }
    
    .sidebar.show ~ .mobile-overlay {
        display: block !important;
    }
    
    /* Main content adjustment */
    .main-content {
        margin-right: 0 !important;
        padding: 80px 15px 20px !important;
        width: 100%;
    }
    
    /* Navigation fixes */
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98) !important;
        padding: 1rem !important;
        margin-top: 1rem !important;
        border-radius: 10px;
    }
    
    /* Form and search fixes */
    .search-input-container {
        flex-direction: column !important;
        padding: 1rem !important;
    }
    
    .search-input-container input {
        margin-bottom: 1rem !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .search-input-container button {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Button fixes */
    .btn-search, .btn-bomb {
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Card fixes */
    .glass-card, .result-container {
        padding: 1.5rem !important;
        margin: 1rem 0 !important;
    }
    
    /* Text fixes */
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    /* Welcome card mobile optimization */
    .welcome-card {
        margin-top: 0 !important;
        border-radius: 15px;
    }
    
    /* Stats grid optimization */
    .stats-card {
        margin-bottom: 0.5rem;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
}

@media (max-width: 992px) {
    /* Medium devices */
    .container {
        max-width: 100%;
    }
    
    /* Sidebar adjustments */
    .sidebar {
        width: 250px;
    }
}

@media (max-width: 1200px) {
    /* Large devices */
    .container {
        max-width: 1140px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .mobile-menu-btn,
    .mobile-overlay,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card,
    .btn,
    .form-control {
        border-width: 0.5px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #0a0f1c;
        --darker: #050913;
        --card: #1a2332;
        --text: #e2e8f0;
        --text-light: #8a9bb0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .feature-card:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    .btn, .nav-link, .form-check-label {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve touch feedback */
    .btn:active, .nav-link:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
    
    .welcome-card {
        padding: 1rem !important;
    }
    
    .feature-card {
        padding: 1rem !important;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    body {
        font-size: 12px !important;
    }
    
    .container {
        padding: 0 5px !important;
    }
    
    .card, .glass-card {
        padding: 0.75rem !important;
    }
    
    .btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
}

/* Z-index management */
.sidebar {
    z-index: 1050;
}

.mobile-overlay {
    z-index: 1040;
}

.mobile-menu-btn {
    z-index: 1060;
}

.navbar {
    z-index: 1030;
}

.modal {
    z-index: 1070;
}

/* Utility classes for mobile */
.mobile-hidden {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

.desktop-only {
    display: none !important;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

/* Safe area insets for notched devices */
@supports(padding: max(0px)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .navbar {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}