/* ===== MOBILE OPTIMIZED STYLES FOR ALL PLATFORMS ===== */

/* Base Mobile Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Touch-friendly buttons */
button, .btn, a {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* iOS Safari Optimizations */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .scroll-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Android Chrome Optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .mobile-optimized {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* Windows Mobile Optimizations */
@media screen and (max-width: 768px) {
    .windows-mobile {
        -ms-touch-action: manipulation;
        touch-action: manipulation;
    }
}

/* Responsive Breakpoints */
@media (max-width: 480px) {
    /* Extra Small Devices (phones) */
    .container {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .card {
        margin: 10px 0;
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Mobile Navigation */
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(30, 30, 50, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(139, 69, 255, 0.2);
        z-index: 1000;
        padding: 10px 0;
    }
    
    .mobile-nav-items {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        font-size: 0.8rem;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-item.active {
        color: #8B45FF;
    }
    
    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    /* Hide desktop navigation on mobile */
    .desktop-nav {
        display: none;
    }
    
    /* Mobile-friendly forms */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Mobile-friendly tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    /* Small Devices (tablets) */
    .container {
        padding: 0 20px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    /* Tablet Navigation */
    .tablet-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
    }
    
    .mobile-nav {
        display: none;
    }
}

@media (min-width: 769px) {
    /* Desktop and larger tablets */
    .mobile-nav {
        display: none;
    }
    
    .desktop-nav {
        display: block;
    }
}

/* Platform-specific optimizations */
/* iOS */
@supports (-webkit-touch-callout: none) {
    .ios-optimized {
        -webkit-overflow-scrolling: touch;
    }
    
    .ios-button {
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .android-optimized {
        transform: translateZ(0);
    }
}

/* Windows */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .windows-optimized {
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
}

/* macOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
    .macos-optimized {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mobile-friendly animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-dark-mode {
        background: #0a0a0a;
        color: #ffffff;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid;
        background: #000000;
        color: #ffffff;
    }
}

/* Mobile-friendly modals */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mobile-modal-content {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile-friendly loading */
.mobile-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(30, 30, 50, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

/* Mobile-friendly alerts */
.mobile-alert {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid #8B45FF;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile-friendly cards */
.mobile-card {
    background: rgba(30, 30, 50, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    border: 1px solid rgba(139, 69, 255, 0.2);
    transition: all 0.3s ease;
}

.mobile-card:active {
    transform: scale(0.98);
}

/* Mobile-friendly buttons */
.mobile-btn {
    background: linear-gradient(135deg, #8B45FF 0%, #6B46C1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.mobile-btn.secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
}

.mobile-btn.danger {
    background: linear-gradient(135deg, #DC3545 0%, #C82333 100%);
}

.mobile-btn.success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

/* Mobile-friendly inputs */
.mobile-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 69, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.mobile-input:focus {
    outline: none;
    border-color: #8B45FF;
    box-shadow: 0 0 0 3px rgba(139, 69, 255, 0.1);
}

.mobile-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile-friendly tables */
.mobile-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.mobile-table th,
.mobile-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(139, 69, 255, 0.2);
}

.mobile-table th {
    background: rgba(139, 69, 255, 0.1);
    font-weight: 600;
}

/* Mobile-friendly navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .mobile-nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.9);
        z-index: 1000;
        padding: 20px;
    }
    
    .mobile-nav-menu.active {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .mobile-nav-menu a {
        color: white;
        text-decoration: none;
        font-size: 1.2rem;
        padding: 15px;
        margin: 5px 0;
        border-radius: 10px;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-menu a:hover {
        background: rgba(139, 69, 255, 0.2);
    }
}

/* Mobile-friendly footer */
.mobile-footer {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(139, 69, 255, 0.2);
    padding: 20px;
    text-align: center;
    margin-top: 50px;
}

/* Mobile-friendly sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0;
}

/* Mobile-friendly dropdown */
.mobile-dropdown {
    position: relative;
    display: inline-block;
}

.mobile-dropdown-content {
    display: none;
    position: absolute;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    border-radius: 12px;
    border: 1px solid rgba(139, 69, 255, 0.2);
}

.mobile-dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.mobile-dropdown-content a:hover {
    background: rgba(139, 69, 255, 0.2);
}

.mobile-dropdown:hover .mobile-dropdown-content {
    display: block;
}

/* Mobile-friendly tooltips */
.mobile-tooltip {
    position: relative;
    display: inline-block;
}

.mobile-tooltip .mobile-tooltiptext {
    visibility: hidden;
    width: 200px;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 8px;
    position: absolute;
    z-index: 1002;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.mobile-tooltip:hover .mobile-tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Mobile-friendly progress bars */
.mobile-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.mobile-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #8B45FF 0%, #6B46C1 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Mobile-friendly badges */
.mobile-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background: rgba(139, 69, 255, 0.2);
    color: #8B45FF;
}

.mobile-badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.mobile-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

.mobile-badge.danger {
    background: rgba(220, 53, 69, 0.2);
    color: #DC3545;
}

/* Mobile-friendly icons */
.mobile-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Mobile-friendly spacing */
.mobile-spacing {
    margin: 15px 0;
}

.mobile-spacing-small {
    margin: 8px 0;
}

.mobile-spacing-large {
    margin: 25px 0;
}

/* Mobile-friendly text */
.mobile-text-small {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.mobile-text-large {
    font-size: 18px;
    font-weight: 600;
}

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

.mobile-text-right {
    text-align: right;
}

/* Mobile-friendly utilities */
.mobile-hidden {
    display: none !important;
}

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

.mobile-flex {
    display: flex !important;
}

.mobile-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-flex-column {
    display: flex;
    flex-direction: column;
}

/* Mobile-friendly shadows */
.mobile-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-shadow-lg {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Mobile-friendly borders */
.mobile-border {
    border: 1px solid rgba(139, 69, 255, 0.2);
}

.mobile-border-top {
    border-top: 1px solid rgba(139, 69, 255, 0.2);
}

.mobile-border-bottom {
    border-bottom: 1px solid rgba(139, 69, 255, 0.2);
}

/* Mobile-friendly gradients */
.mobile-gradient-primary {
    background: linear-gradient(135deg, #8B45FF 0%, #6B46C1 100%);
}

.mobile-gradient-secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
}

.mobile-gradient-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.mobile-gradient-danger {
    background: linear-gradient(135deg, #DC3545 0%, #C82333 100%);
}

/* Mobile-friendly animations */
@keyframes mobileFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-fade-in {
    animation: mobileFadeIn 0.5s ease;
}

@keyframes mobileSlideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.mobile-slide-in {
    animation: mobileSlideIn 0.3s ease;
}

/* Mobile-friendly responsive images */
.mobile-img-responsive {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Mobile-friendly responsive videos */
.mobile-video-responsive {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.mobile-video-responsive iframe,
.mobile-video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Mobile-friendly responsive embeds */
.mobile-embed-responsive {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
}

.mobile-embed-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Mobile-friendly print styles */
@media print {
    .mobile-nav,
    .mobile-sidebar,
    .mobile-modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .mobile-card {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
    }
}

/* Mobile-friendly accessibility */
@media (prefers-reduced-motion: reduce) {
    .mobile-fade-in,
    .mobile-slide-in {
        animation: none;
    }
}

/* Mobile-friendly focus styles */
.mobile-btn:focus,
.mobile-input:focus {
    outline: 2px solid #8B45FF;
    outline-offset: 2px;
}

/* Mobile-friendly selection */
.mobile-selectable {
    -webkit-user-select: text;
    user-select: text;
}

/* Mobile-friendly scrolling */
.mobile-scroll-smooth {
    scroll-behavior: smooth;
}

/* Mobile-friendly viewport */
.mobile-viewport {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Mobile-friendly safe areas */
.mobile-safe-area {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Mobile-friendly status bar */
.mobile-status-bar {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    height: env(safe-area-inset-top);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* Mobile-friendly keyboard */
@media screen and (max-height: 500px) {
    .mobile-keyboard-open {
        padding-bottom: 200px;
    }
}

/* Mobile-friendly landscape */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .mobile-landscape {
        flex-direction: row;
    }
    
    .mobile-landscape .mobile-card {
        flex: 1;
        margin: 0 10px;
    }
}

/* Mobile-friendly portrait */
@media screen and (orientation: portrait) {
    .mobile-portrait {
        flex-direction: column;
    }
}

/* Mobile-friendly high DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mobile-high-dpi {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Mobile-friendly low DPI */
@media (-webkit-max-device-pixel-ratio: 1), (max-resolution: 96dpi) {
    .mobile-low-dpi {
        image-rendering: auto;
    }
}

/* Mobile-friendly color blind support */
@media (prefers-contrast: high) {
    .mobile-color-blind {
        filter: contrast(1.5);
    }
}

/* Mobile-friendly monochrome */
@media (prefers-color-scheme: dark) and (prefers-contrast: high) {
    .mobile-monochrome {
        filter: grayscale(1);
    }
}

/* Mobile-friendly reduced data */
@media (prefers-reduced-data: reduce) {
    .mobile-reduced-data {
        background-image: none !important;
        animation: none !important;
        transition: none !important;
    }
}

/* Mobile-friendly battery saver */
@media (prefers-reduced-motion: reduce) and (prefers-reduced-data: reduce) {
    .mobile-battery-saver {
        background: none !important;
        animation: none !important;
        transition: none !important;
        filter: none !important;
    }
} 