/* Modern CSS - Enhanced features for newer devices */
/* This file is only loaded on devices that support modern CSS features */

/* Modern Flexbox Layout (not supported on Android 4.2.2) */
.modern-device .row {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

.modern-device .col {
    display: flex;
    flex-direction: column;
    padding: 5px;
}

.modern-device .stats-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modern-device .stat-card {
    display: block;
    flex: 1;
    padding: 0;
}

/* Enhanced Navigation */
.modern-device .header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 50%, #0d47a1 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modern-device .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.modern-device .logo {
    display: flex;
    align-items: center;
    width: auto;
}

.modern-device .logo-text {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-device .nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-device .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modern-device .nav-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-device .nav-link:hover:before {
    left: 100%;
}

.modern-device .nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.modern-device .nav-link.active {
    background: linear-gradient(135deg, #bbdefb 0%, #062c2c 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(8, 56, 56, 0.3);
}

.modern-device .nav-link.logout {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    border-color: rgba(183, 28, 28, 0.5);
}

.modern-device .nav-link.logout:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
}

/* Enhanced Footer */
.modern-device .footer {
    background: #1976d2;
    box-shadow: 0 -4px 12px rgba(8, 56, 56, 0.2);
    border-top: 3px solid #1565c0;
    color: #ffffff;
}

.modern-device .footer-text {
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.modern-device .footer-year {
    opacity: 0.8;
    color: #e3f2fd;
}

/* Enhanced Cards */
.modern-device .card {
    transition: all 0.3s ease;
    border: 1px solid #1976d2;
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
}

.modern-device .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #64b5f6;
}

.modern-device .card-header {
    background: linear-gradient(135deg, #1976d2 0%, #e3f2fd 100%);
    position: relative;
}

.modern-device .card-header:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #64b5f6, #1976d2, #64b5f6);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Enhanced Buttons */
.modern-device .btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: none;
    background-size: 200% 100%;
    cursor: pointer;
}

.modern-device .btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-device .btn:hover:before {
    left: 100%;
}

.modern-device .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modern-device .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modern-device .btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #e3f2fd 100%);
}

.modern-device .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.modern-device .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.modern-device .btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

/* Enhanced Forms */
.modern-device .form-control {
    transition: all 0.3s ease;
    border-radius: 6px;
}

.modern-device .form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(26, 95, 95, 0.2);
    transform: scale(1.01);
}

/* Enhanced Tables */
.modern-device .table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.modern-device .table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.modern-device .table tbody tr {
    transition: all 0.2s ease;
}

.modern-device .table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.005);
}

/* Enhanced Status Indicators */
.modern-device .status {
    position: relative;
    overflow: hidden;
    animation: pulse 2s ease-in-out infinite;
}

.modern-device .status:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: statusShine 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes statusShine {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.modern-device .status-running {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    animation: runningPulse 2s ease-in-out infinite;
}

@keyframes runningPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
    }
}

/* Enhanced Messages */
.modern-device .message {
    position: relative;
    overflow: hidden;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modern-device .message:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 100%);
}

.modern-device .message-close {
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-device .message-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Loading Animation */
.modern-device .loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #1976d2;
    border-top: 2px solid #64b5f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Advanced Grid System */
.modern-device .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* CSS Grid Support */
@supports (display: grid) {
    .modern-device .grid {
        display: grid;
        gap: 20px;
    }

    .modern-device .grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .modern-device .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .modern-device .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .modern-device .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Accessibility Improvements */
.modern-device .btn:focus,
.modern-device .form-control:focus,
.modern-device .nav-link:focus {
    outline: 2px solid #64b5f6;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .modern-device * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Performance Mode for Low-End Modern Devices */
@media (max-width: 768px) and (min-resolution: 150dpi) {
    .modern-device .card:hover {
        transform: none;
    }

    .modern-device .btn:hover {
        transform: none;
    }

    .modern-device .table-hover tbody tr:hover {
        transform: none;
    }
}

/* Smooth Scrolling */
.modern-device html {
    scroll-behavior: smooth;
}

/* Custom Scrollbars */
.modern-device ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modern-device ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modern-device ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1976d2 0%, #e3f2fd 100%);
    border-radius: 4px;
}

.modern-device ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}