/* Mobile-First Responsive Design for SmartTools */

/* Base mobile styles */
@media (max-width: 767.98px) {
    /* Navigation improvements */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Dropdown menus for mobile */
    .dropdown-menu {
        border: none;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        margin-top: 0.5rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Main content adjustments */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* PDF Tool Template Mobile Optimizations */
    .pdf-tool-container {
        padding: 1rem 0.5rem;
    }
    
    .upload-area {
        min-height: 200px;
        padding: 2rem 1rem;
        border-radius: 12px;
    }
    
    .upload-area h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .upload-area p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .upload-area .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* File list mobile optimization */
    .file-list {
        margin-top: 1rem;
    }
    
    .file-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }
    
    .file-item .file-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-item .file-name {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .file-item .file-size {
        font-size: 0.8rem;
        color: #6c757d;
    }
    
    .file-item .file-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .file-item .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Progress bars mobile */
    .progress {
        height: 8px;
        margin: 0.5rem 0;
    }
    
    .progress-text {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
    
    /* Sidebar mobile optimization */
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 56px);
        background: white; /* light mode */
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    [data-theme="dark"] .sidebar {
        background: #1e293b; /* dark mode */
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Team collaboration mobile */
    .team-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .team-name {
        font-size: 1rem;
    }
    
    .team-description {
        font-size: 0.85rem;
    }
    
    .team-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    /* Modal mobile optimization */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    /* Form mobile optimization */
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* Card mobile optimization */
    .card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    /* Touch-friendly elements */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Swipe gestures for file operations */
    .file-item {
        position: relative;
        overflow: hidden;
    }
    
    .file-item .swipe-actions {
        position: absolute;
        right: -100px;
        top: 0;
        height: 100%;
        width: 100px;
        background: #dc3545;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right 0.3s ease;
    }
    
    .file-item.swiped .swipe-actions {
        right: 0;
    }
    
    .swipe-actions .btn {
        background: transparent;
        border: none;
        color: white;
        padding: 0.5rem;
    }
    
    /* Loading states mobile */
    .loading-spinner {
        width: 2rem;
        height: 2rem;
    }
    
    .loading-text {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    /* Error states mobile */
    .alert {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    /* Success states mobile */
    .success-message {
        padding: 0.75rem 1rem;
        background: #d4edda;
        border: 1px solid #c3e6cb;
        border-radius: 8px;
        color: #155724;
        font-size: 0.9rem;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .upload-area {
        min-height: 250px;
        padding: 2.5rem 2rem;
    }
    
    .file-item .file-info {
        flex-direction: row;
        align-items: center;
    }
    
    .file-item .file-actions {
        margin-top: 0;
        width: auto;
    }
    
    .sidebar {
        position: relative;
        left: auto;
        width: auto;
        height: auto;
        box-shadow: none;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .sidebar {
        position: relative;
        left: auto;
        width: auto;
        height: auto;
        box-shadow: none;
    }
    
    .upload-area {
        min-height: 300px;
        padding: 3rem 2rem;
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Hide browser UI elements */
    .browser-only {
        display: none !important;
    }
}

/* Dark mode support - Now handled by data-theme attribute */
[data-theme="dark"] .card {
    background-color: #1e293b;
    border-color: rgba(148,163,184,0.2);
}

[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: rgba(148,163,184,0.2);
}

[data-theme="dark"] .file-item {
    background-color: #1e293b;
    border-color: rgba(148,163,184,0.2);
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
    
    .file-item {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .file-item .swipe-actions,
    .modal-dialog {
        transition: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}
