/* Sandman Custom Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading animations */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Status indicators */
.status-indicator {
    position: relative;
    display: inline-block;
}

.status-indicator::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

.status-running::before {
    background-color: #10b981;
    animation: pulse-green 2s infinite;
}

.status-stopped::before {
    background-color: #ef4444;
}

.status-unknown::before {
    background-color: #6b7280;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* VM table enhancements */
.vm-table tr:hover {
    background-color: #f9fafb;
}

.vm-table td {
    vertical-align: middle;
}

/* Schedule time slots */
.time-slot {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

/* Modal animations */
.modal-enter {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
}

/* Toast notifications */
.toast-enter {
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.toast-enter-active {
    opacity: 1;
    transform: translateX(0);
}

.toast-exit {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.toast-exit-active {
    opacity: 0;
    transform: translateX(100%);
}

/* Form enhancements */
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button states */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dashboard cards */
.dashboard-card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Sidebar enhancements */
.sidebar-item {
    transition: background-color 0.2s ease-out;
}

.sidebar-item:hover {
    background-color: #374151;
}

.sidebar-item.active {
    background-color: #1f2937;
    border-right: 3px solid #3b82f6;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode .card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .dark-mode .form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
}

/* Accessibility enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Navigation tab indicator */
.nav-link {
    position: relative;
}

.nav-link .absolute {
    position: absolute;
    bottom: -1rem; /* Extend to the bottom of the header */
    left: 0;
    right: 0;
    height: 2px;
    background-color: #8b5cf6;
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(4px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

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

.bounce-in {
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* VM Status Toggle Controls */
.vm-status-toggle {
    transition: all 0.2s ease-out;
}

.vm-status-toggle:checked + div {
    background-color: #16a34a;
}

.vm-status-toggle:disabled + div {
    opacity: 0.5;
    cursor: not-allowed;
}

.vm-status-toggle:focus + div {
    ring: 2px;
    ring-color: #16a34a;
    ring-opacity: 0.5;
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.running {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.stopped {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Button Loading States */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modal Button Hover Effects */
#cancel-shutdown-btn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

#confirm-shutdown-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Focus States for Accessibility */
.vm-status-toggle:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Animation for VM Status Updates */
.vm-status-updating {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
