/* Base styles with elegant digital monitor theme and anime influences - Light Version */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #7209b7;
    --secondary-color: #4cc9f0;
    --accent-color: #f72585;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    --neutral-dark: #333333;
    --neutral-light: #ffffff;
    --background-color: #f0f2f5;
    --glow-shadow: 0 0 12px rgba(76, 201, 240, 0.8);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    --anime-gradient: linear-gradient(135deg, #4361ee, #7209b7);
}

/* Custom scrollbar for a futuristic look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e0e0e0;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

body {
    font-family: 'Sarabun', sans-serif;
    background: var(--background-color) url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2YwZjJmNSI+PC9yZWN0Pgo8Y2lyY2xlIGN4PSIxIiBjeT0iMSIgcj0iMSIgZmlsbD0iI2U2ZTZlNiI+PC9jaXJjbGU+Cjwvc3ZnPg==');
    color: var(--neutral-dark);
    position: relative;
    min-height: 100vh;
}

/* Digital screen glow effect on main container */
#mainApp, #loginPage {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.navbar {
    background: var(--anime-gradient) !important;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 5px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem !important;
    position: relative;
    z-index: 10;
}

.navbar-brand {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Enhanced card styles with digital monitor feel and STRONG SHADOWS */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.12);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(76, 201, 240, 0.4), 0 10px 15px rgba(76, 201, 240, 0.3);
    animation: none; /* Stop animation on hover */
}

.summary-card-online:hover,
.summary-card-offline:hover,
.summary-card-total:hover {
    transform: translateY(-5px);
    animation: none; /* Stop animation on hover */
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: bold;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Device card status styles with glowing effects */
.device-active {
    background: linear-gradient(135deg, rgba(0, 255, 133, 0.2), rgba(0, 255, 133, 0.1));
    color: #00552d;
    border-left: 4px solid #00ff85;
}

.device-inactive {
    background: linear-gradient(135deg, rgba(239, 71, 111, 0.15), rgba(239, 71, 111, 0.05));
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

/* Enhanced summary cards with anime-inspired gradients and STRONG SHADOWS */
.summary-card-online {
    background: linear-gradient(135deg, #00ff85 0%, #00c580 100%);
    color: white;
    border-left: 4px solid #00ff85;
    box-shadow: 0 15px 30px rgba(0, 255, 133, 0.3), 0 8px 15px rgba(0, 0, 0, 0.15);
}

.summary-card-offline {
    background: linear-gradient(135deg, #ef476f 0%, #e9698e 100%);
    color: white;
    border-left: 4px solid #ef476f;
    box-shadow: 0 15px 30px rgba(239, 71, 111, 0.3), 0 8px 15px rgba(0, 0, 0, 0.15);
}

.summary-card-total {
    background: linear-gradient(135deg, #4361ee 0%, #4cc9f0 100%);
    color: white;
    border-left: 4px solid #4361ee;
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.3), 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Card count numbers with digital display style */
.summary-card-online h2, 
.summary-card-offline h2, 
.summary-card-total h2 {
    font-family: 'Arial', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Loading spinner with futuristic animation */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner-border {
    border-width: 0.2em;
    animation: spinner-glow 1.5s ease-in-out infinite;
}

@keyframes spinner-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(76, 201, 240, 0); }
    50% { box-shadow: 0 0 15px rgba(76, 201, 240, 0.7); }
}

/* Digital timestamp display */
.timestamp {
    font-family: 'Arial', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
    margin-top: 10px;
    letter-spacing: 1px;
}

/* Status badges with glowing animation for active devices */
.status-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-weight: normal;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bg-success {
    background-color: #00ff85 !important; /* Brighter green */
    animation: pulse-success 1s infinite; /* Faster animation (1s instead of 3s) */
    box-shadow: 0 0 10px #00ff85; /* Constant glow effect */
}
.bg-danger {
    background-color: var(--danger-color) !important;
}

@keyframes pulse-success {
    0% { 
        opacity: 1;
        box-shadow: 0 0 15px #00ff85; 
    }
    50% { 
        opacity: 0.7;
        box-shadow: 0 0 5px #00ff85; 
    }
    100% { 
        opacity: 1;
        box-shadow: 0 0 15px #00ff85; 
    }
}

/* Device info styling */
.device-info {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
}

.device-info:last-child {
    border-bottom: none;
}

.device-info-label {
    font-weight: 500;
    margin-right: 0.5rem;
    width: 42%;
    display: inline-block;
    color: #495057;
    font-size: 0.85rem;
}

/* Digital time display for overdue items */
.time-overdue {
    color: var(--danger-color);
    font-weight: 500;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Button styles with hover effects and STRONG SHADOWS */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 15px rgba(76, 201, 240, 0.5);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.5);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.5);
}

/* Special styling for restart button with STRONGER SHADOW */
.restart-device-btn:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    box-shadow: 0 6px 15px rgba(239, 71, 111, 0.5);
}

.restart-device-btn:active {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Improved View Toggle Button Group */
.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Search input styling */
.input-group .form-control {
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--neutral-dark);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.input-group .form-control:focus {
    background-color: white;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.25) !important;
    border-color: var(--primary-color);
    color: var(--neutral-dark);
}

.input-group .form-control::placeholder {
    color: #6c757d;
}

/* Tabs styling with SHADOWS */
.nav-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-tabs .nav-link {
    color: #495057;
    border: none;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(76, 201, 240, 0.05);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(76, 201, 240, 0.05));
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Table styling with CARD-LIKE SHADOW */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table {
    color: var(--neutral-dark);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.table thead th {
    background-color: rgba(67, 97, 238, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-striped tbody tr:hover {
    background-color: rgba(76, 201, 240, 0.1);
}

/* Login form styling with STRONG SHADOWS*/
#loginForm .form-control {
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--neutral-dark);
    padding: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

#loginForm .form-control:focus {
    background-color: white;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.25) !important;
    border-color: var(--primary-color);
}

#loginForm .form-label {
    color: var(--primary-dark);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Modal styling with DRAMATIC SHADOW*/
.modal-content {
    background-color: white;
    border: none;
    color: var(--neutral-dark);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Alerts styling with STRONGER SHADOWS */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.alert-success {
    background-color: rgba(6, 214, 160, 0.1);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 71, 111, 0.1);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

/* Compact view styles */
.compact-view .card {
    height: 100%;
}

.compact-view .card-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.compact-view .card-body {
    padding: 0.75rem;
}

.compact-view .device-info {
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    display: flex;
    flex-wrap: nowrap;
    font-size: 0.8rem;
}

.compact-view .device-info-label {
    width: 35%;
}

/* Extra compact view styles */
.extra-compact-view .col-device {
    margin-bottom: 8px;
}

.extra-compact-view .card {
    margin-bottom: 8px;
}

.extra-compact-view .card-body {
    padding: 0.5rem;
}

/* Custom styles for digital display elements */
.digital-num {
    font-family: 'Arial', monospace;
    letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .device-count {
        text-align: center;
    }
    
    .btn-group {
        margin-bottom: 10px;
    }
    
    .summary-card-online h2, 
    .summary-card-offline h2, 
    .summary-card-total h2 {
        font-size: 2rem;
    }
}

/* Anime-inspired power button animation */
@keyframes power-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

#refreshBtn:hover i {
    animation: power-pulse 1s infinite;
    color: #fff;
}

/* Glowing border effect for focused elements */
.form-control:focus, .btn:focus {
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.5) !important;
}

/* Custom badge styling for status indicators */
.badge {
    padding: 0.4em 0.65em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Card glow effects when hovering - MUCH STRONGER */
.card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 15px 20px rgba(76, 201, 240, 0.2);
}

.summary-card-online:hover {
    box-shadow: 0 15px 35px rgba(0, 255, 133, 0.5), 0 8px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.summary-card-offline:hover {
    box-shadow: 0 15px 35px rgba(239, 71, 111, 0.4), 0 8px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.summary-card-total:hover {
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.4), 0 8px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.12);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    animation: card-pulse 3s infinite;
}
.card-header.device-active {
    animation: green-card-pulse 2s infinite;
}
.card-header.device-inactive {
    animation: red-card-pulse 2s infinite;
}
@keyframes card-pulse {
    0% {
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.12);
    }
    50% {
        box-shadow: 0 15px 30px rgba(76, 201, 240, 0.3), 0 8px 20px rgba(0, 0, 0, 0.12);
    }
    100% {
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.12);
    }
}

/* Keyframes for online card header pulsing */
@keyframes green-card-pulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 255, 133, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 255, 133, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 255, 133, 0.3);
    }
}

/* Keyframes for offline card header pulsing */
@keyframes red-card-pulse {
    0% {
        box-shadow: 0 0 5px rgba(239, 71, 111, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(239, 71, 111, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(239, 71, 111, 0.3);
    }
}

/* Enhanced blinking for online status */
.bg-success {
    background-color: #00ff85 !important; /* Brighter green */
    animation: pulse-success 1s infinite; /* Faster animation (1s instead of 3s) */
    box-shadow: 0 0 10px #00ff85; /* Constant glow effect */
}

@keyframes pulse-success {
    0% { 
        opacity: 1;
        box-shadow: 0 0 15px #00ff85; 
    }
    50% { 
        opacity: 0.7;
        box-shadow: 0 0 5px #00ff85; 
    }
    100% { 
        opacity: 1;
        box-shadow: 0 0 15px #00ff85; 
    }
}

.summary-card-online,
.summary-card-offline,
.summary-card-total {
    animation: summary-card-pulse 2s infinite;
    transition: all 0.3s ease;
}

.summary-card-online {
    background: linear-gradient(135deg, #00ff85 0%, #00c580 100%);
    box-shadow: 0 15px 30px rgba(0, 255, 133, 0.3), 0 8px 15px rgba(0, 0, 0, 0.15);
}

@keyframes summary-card-pulse {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Add 3D effect to cards with shadow underneath */
.card::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 90%;
    height: 10px;
    left: 5%;
    bottom: 0px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover::after {
    width: 85%;
    left: 7.5%;
    height: 15px;
    bottom: -5px;
    box-shadow: 0 25px 20px rgba(0, 0, 0, 0.2);
}

/* Add some anime-style decorative elements */
.navbar::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(76, 201, 240, 0.8) 20%, 
        rgba(114, 9, 183, 0.8) 80%, 
        transparent 100%);
    border-radius: 0 0 8px 8px;
}