/* Mobile Optimization CSS for Awards Ceremony Management System */

/* ===== MOBILE-FIRST APPROACH ===== */

/* Base Mobile Styles */
@media (max-width: 768px) {
    /* Typography Optimization */
    html {
        font-size: 14px; /* Slightly smaller base font for mobile */
    }      
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    /* Touch-Friendly Buttons */
    .btn {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
        touch-action: manipulation;
    }
    
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-lg {
        min-height: 48px;
        min-width: 48px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Form Controls */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    /* Navigation Mobile Optimization */
    .navbar-custom {
        padding: 0.5rem 0;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-custom .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-custom .navbar-nav .nav-link {
        padding: 1rem !important;
        margin: 0.25rem 0;
        border-radius: 8px;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-custom .navbar-nav .nav-link i {
        margin-right: 0.75rem;
        font-size: 1.1rem;
    }
    
    /* Mobile Menu Toggle */
    .navbar-toggler {
        padding: 0.5rem;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.25);
    }
    
    /* Cards Mobile Optimization */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        padding: 1rem;
        border-radius: 12px 12px 0 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 1rem;
        border-radius: 0 0 12px 12px;
    }
    
    /* Tables Mobile Optimization */
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
    }
    
    /* Modal Mobile Optimization */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        border-radius: 0 0 12px 12px;
    }
    
    /* Grid System Mobile Optimization */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col, [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Spacing Mobile Optimization */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ===== SMALL MOBILE DEVICES ===== */
@media (max-width: 576px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Even smaller buttons for very small screens */
    .btn {
        min-height: 40px;
        min-width: 40px;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        min-height: 32px;
        min-width: 32px;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Compact forms */
    .form-control, .form-select {
        min-height: 40px;
        padding: 0.6rem;
        font-size: 16px;
    }
    
    /* Compact cards */
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-footer {
        padding: 0.75rem;
    }
    
    /* Compact tables */
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Compact modals */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
}

/* ===== LARGE MOBILE DEVICES ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .btn {
        min-height: 46px;
        min-width: 46px;
        padding: 0.8rem 1.2rem;
    }
    
    .form-control, .form-select {
        min-height: 46px;
        padding: 0.8rem;
    }
}

/* ===== TOUCH INTERACTIONS ===== */

/* Touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .nav-link:hover {
        transform: none;
    }
}

/* Active states for touch devices */
.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.card:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
}

/* ===== MOBILE NAVIGATION ENHANCEMENTS ===== */

/* Mobile menu animations */
.navbar-collapse {
    transition: all 0.3s ease;
}

.navbar-collapse.collapsing {
    transition: all 0.3s ease;
}

/* Mobile menu backdrop */
.navbar-collapse.show {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 0.5rem;
    padding: 0.5rem;
}

/* ===== MOBILE FORM ENHANCEMENTS ===== */

/* Mobile-friendly form layouts */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .form-row > .col:last-child,
    .form-row > [class*="col-"]:last-child {
        margin-bottom: 0;
    }
    
    /* Stack form groups vertically */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* Full-width inputs on mobile */
    .form-control,
    .form-select,
    .btn {
        width: 100%;
    }
    
    /* Exception for inline forms */
    .form-inline .form-control,
    .form-inline .form-select,
    .form-inline .btn {
        width: auto;
    }
}

/* ===== MOBILE TABLE ENHANCEMENTS ===== */

/* Responsive table patterns */
@media (max-width: 768px) {
    /* Stack table cells vertically */
    .table-responsive-stack .table,
    .table-responsive-stack .table thead,
    .table-responsive-stack .table tbody,
    .table-responsive-stack .table th,
    .table-responsive-stack .table td,
    .table-responsive-stack .table tr {
        display: block;
    }
    
    .table-responsive-stack .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-responsive-stack .table tr {
        border: 1px solid #dee2e6;
        margin-bottom: 1rem;
        border-radius: 8px;
        background: white;
    }
    
    .table-responsive-stack .table td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: left;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .table-responsive-stack .table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0.5rem;
        width: 45%;
        font-weight: bold;
        color: #495057;
    }
    
    /* Hide less important columns on mobile */
    .table-responsive-hide .table th:nth-child(n+4),
    .table-responsive-hide .table td:nth-child(n+4) {
        display: none;
    }
}

/* ===== MOBILE DASHBOARD OPTIMIZATIONS ===== */

@media (max-width: 768px) {
    /* Dashboard stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    /* Dashboard actions */
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .action-btn {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Dashboard header */
    .dashboard-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
}

/* ===== MOBILE NOTIFICATIONS ===== */

/* Mobile-friendly notification styles */
@media (max-width: 768px) {
    .alert {
        margin-bottom: 1rem;
        padding: 1rem;
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    .toast {
        max-width: calc(100% - 2rem);
        margin: 0.5rem;
    }
    
    .toast-header {
        padding: 0.75rem;
    }
    
    .toast-body {
        padding: 0.75rem;
    }
}

/* ===== MOBILE LOADING STATES ===== */

/* Mobile-optimized loading indicators */
@media (max-width: 768px) {
    .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    .spinner-border-sm {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .loading-spinner {
        padding: 2rem;
    }
}

/* ===== MOBILE SCROLLING ENHANCEMENTS ===== */

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    /* Custom scrollbar for webkit browsers */
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

/* ===== MOBILE ACCESSIBILITY ===== */

/* Focus indicators for mobile */
@media (max-width: 768px) {
    .btn:focus,
    .form-control:focus,
    .form-select:focus,
    .nav-link:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .btn,
        .form-control,
        .form-select {
            border-width: 2px;
        }
    }
    
    /* 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;
        }
    }
}

/* ===== MOBILE PERFORMANCE OPTIMIZATIONS ===== */

/* Optimize animations for mobile */
@media (max-width: 768px) {
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        animation-duration: 0.3s;
    }
    
    /* Reduce box shadows on mobile for better performance */
    .card,
    .btn,
    .navbar-custom {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .card:hover,
    .btn:hover {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }
}

/* ===== MOBILE PRINT STYLES ===== */

@media print and (max-width: 768px) {
    .navbar,
    .footer,
    .btn,
    .modal,
    .toast {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        border: 1px solid #000;
    }
}

/* ===== MOBILE UTILITY CLASSES ===== */

/* Mobile-specific utility classes */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-text-left {
        text-align: left !important;
    }
    
    .mobile-text-right {
        text-align: right !important;
    }
    
    .mobile-mt-0 { margin-top: 0 !important; }
    .mobile-mt-1 { margin-top: 0.25rem !important; }
    .mobile-mt-2 { margin-top: 0.5rem !important; }
    .mobile-mt-3 { margin-top: 1rem !important; }
    .mobile-mt-4 { margin-top: 1.5rem !important; }
    .mobile-mt-5 { margin-top: 3rem !important; }
    
    .mobile-mb-0 { margin-bottom: 0 !important; }
    .mobile-mb-1 { margin-bottom: 0.25rem !important; }
    .mobile-mb-2 { margin-bottom: 0.5rem !important; }
    .mobile-mb-3 { margin-bottom: 1rem !important; }
    .mobile-mb-4 { margin-bottom: 1.5rem !important; }
    .mobile-mb-5 { margin-bottom: 3rem !important; }
    
    .mobile-p-0 { padding: 0 !important; }
    .mobile-p-1 { padding: 0.25rem !important; }
    .mobile-p-2 { padding: 0.5rem !important; }
    .mobile-p-3 { padding: 1rem !important; }
    .mobile-p-4 { padding: 1.5rem !important; }
    .mobile-p-5 { padding: 3rem !important; }
}

/* ===== MOBILE GESTURE SUPPORT ===== */

/* Swipe gestures for mobile */
@media (max-width: 768px) {
    .swipeable {
        touch-action: pan-y pinch-zoom;
    }
    
    .swipeable-horizontal {
        touch-action: pan-x pinch-zoom;
    }
    
    /* Prevent text selection on interactive elements */
    .btn,
    .nav-link,
    .card {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection on content areas */
    .card-body,
    .modal-body,
    .form-control {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
} 