/* 
   FilmForge - Mobile Responsive CSS
   Mobile-first design with proper breakpoints
*/

/* Film Strip Responsive Design */
.film-strip-container {
    /* Desktop version - full animation */
}

@media (max-width: 576px) {
    /* Hide complex film strip on very small screens */
    .film-strip-container {
        height: 30px !important;
    }
    
    .film-negative-frame {
        min-width: 40px !important;
        height: 30px !important;
    }
    
    /* Slower animation for mobile to reduce motion sensitivity */
    .film-strip-endless {
        animation-duration: 35s !important;
    }
}

@media (max-width: 767.98px) {
    /* Reduced film strip size for tablets */
    .film-strip-container {
        height: 45px !important;
        margin: 1rem 0 !important;
    }
    
    .film-negative-frame {
        min-width: 50px !important;
        height: 45px !important;
    }
}

/* Mobile First - Base styles for mobile devices */
@media (max-width: 767.98px) {
    /* Hero section text adjustments */
    .hero-content h1 {
        font-size: 2.5rem !important;
    }
    
    .hero-content h2 {
        font-size: 1.2rem !important;
    }
    
    .hero-content p.lead {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
    }
    
    /* Navigation fixes */
    .navbar {
        padding: 0.5rem 1rem !important;
    }
    
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    .nav-link.btn {
        padding: 0.375rem 0.75rem !important;
        margin: 0.25rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Sidebar mobile behavior */
    #sidebar-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        z-index: 1050;
        width: 80vw !important; /* Changed from 100vw to 80vw */
        max-width: 320px !important;
        height: 100vh;
        margin-left: -80vw !important; /* Changed from -100vw */
        transition: margin-left 0.3s ease-in-out;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    #sidebar-wrapper.toggled {
        margin-left: 0 !important;
    }
    
    /* Add overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Swipe hint styling */
    #swipe-hint {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        transition: all 0.3s ease;
    }
    
    /* Admin panel mobile improvements */
    .admin-panel-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .admin-panel-actions {
        width: 100%;
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    .admin-panel-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Main content mobile adjustments */
    #page-content-wrapper {
        padding-left: 0 !important;
        width: 100% !important;
    }
    
    /* Landing page hero section */
    .landing-page {
        padding-top: 60px !important;
    }
    
    .hero-section {
        padding: 2rem 0 !important;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem !important;
        margin-bottom: 2rem;
    }
    
    /* Feature cards mobile layout */
    .features-section {
        padding: 2rem 0 !important;
    }
    
    .feature-card {
        margin-bottom: 1rem;
        padding: 1.5rem !important;
    }
    
    .feature-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .feature-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem;
    }
    
    .feature-card p {
        font-size: 0.875rem !important;
        line-height: 1.4;
    }
    
    /* Department grid mobile */
    .row.g-4 > .col-md-6.col-lg-3 {
        margin-bottom: 1rem;
    }
    
    /* CTA section mobile */
    .cta-section {
        padding: 2rem 0 !important;
    }
    
    .cta-section h2 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
    }
    
    .cta-section .lead {
        font-size: 0.95rem !important;
        line-height: 1.5;
    }
    
    .cta-section .row.g-4 > .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    /* Dashboard mobile adjustments */
    .dashboard {
        padding: 1rem 0 !important;
    }
    
    .stat-card {
        flex-direction: column !important;
        text-align: center;
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
    
    .stat-icon {
        margin-bottom: 0.5rem;
    }
    
    /* Project cards mobile */
    .project-card {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    .project-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .project-title {
        font-size: 1rem !important;
        margin-bottom: 0.5rem;
    }
    
    .project-stats {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    /* Department cards mobile */
    .department-card {
        padding: 1rem !important;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .department-icon {
        margin: 0 auto 0.75rem auto !important;
    }
    
    /* Chat interface mobile */
    .chat-page {
        height: calc(100vh - 80px) !important;
        padding: 0.5rem !important;
    }
    
    .chat-container {
        
    }
    
    .chat-header {
        padding: 0.75rem !important;
    }
    
    .chat-header h1 {
        font-size: 1.25rem !important;
    }
    
    .chat-messages {
        padding: 0.75rem !important;
    }
    
    .message {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .message-avatar {
        width: 32px !important;
        height: 32px !important;
        align-self: flex-start;
    }
    
    .message-content {
        width: 100%;
    }
    
    .message-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .message-text {
        padding: 0.75rem !important;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .chat-input {
        padding: 0.75rem !important;
    }
    
    .chat-input .form-control {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Quick actions mobile */
    .quick-actions {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .quick-action-btn {
        padding: 1rem !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left;
    }
    
    /* Forms mobile */
    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.75rem !important;
    }
    
    .btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn-lg {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Timeline mobile */
    .timeline::before {
        left: 15px !important;
    }
    
    .timeline-item {
        padding-left: 2.5rem !important;
    }
    
    .timeline-marker {
        left: -8px !important;
        width: 24px !important;
        height: 24px !important;
    }
    
    .timeline-content {
        padding: 0.75rem !important;
    }
    
    /* Modal mobile */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-content {
        
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem !important;
    }
    
    /* Interactive elements mobile */
    .hover-card:hover {
        transform: none !important; /* Disable hover effects on mobile */
    }
    
    /* Touch-friendly buttons */
    .btn,
    .list-group-item,
    .nav-link {
        min-height: 44px !important; /* Apple's recommended touch target size */
        display: flex !important;
        align-items: center;
    }
    
    /* Responsive text sizes */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    h4 { font-size: 1.25rem !important; }
    h5 { font-size: 1.1rem !important; }
    h6 { font-size: 1rem !important; }
    
    /* Container padding mobile */
    .container,
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Hide desktop-only elements */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Menu toggle button */
    #menu-toggle {
        position: fixed !important;
        top: 1rem !important;
        left: 1rem !important;
        z-index: 1060 !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        
    }
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 991.98px) {
    #sidebar-wrapper {
        width: 12rem !important;
        margin-left: -12rem !important;
    }
    
    #page-content-wrapper {
        padding-left: 0 !important;
    }
    
    #page-content-wrapper.sidebar-open {
        padding-left: 12rem !important;
    }
    
    .feature-card {
        padding: 1.75rem !important;
    }
    
    .department-card {
        padding: 1.25rem !important;
    }
    
    .chat-messages {
        padding: 1rem !important;
    }
    
    .message {
        gap: 0.75rem !important;
    }
}

/* Tablet Landscape and Desktop */
@media (min-width: 992px) {
    #sidebar-wrapper {
        margin-left: 0 !important;
    }
    
    #page-content-wrapper {
        padding-left: 15rem !important;
    }
    
    #menu-toggle {
        display: none !important;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .hero-section h1 {
        font-size: 3.5rem !important;
    }
    
    .hero-section .lead {
        font-size: 1.25rem !important;
    }
    
    .feature-card {
        padding: 2rem !important;
    }
    
    .department-card {
        padding: 1.5rem !important;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .btn,
    .form-control,
    .form-select,
    .list-group-item,
    .nav-link,
    .dropdown-item {
        min-height: 44px !important;
    }
    
    .feature-card:hover,
    .department-card:hover,
    .project-card:hover,
    .stat-card:hover {
        transform: none !important;
        box-shadow: inherit !important;
    }
    
    .feature-card:active,
    .department-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feature-card,
    .department-card,
    .project-card {
        border: 2px solid !important;
    }
    
    .btn {
        border: 2px solid !important;
    }
}

/* 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;
    }
}