/* Virtualizor-inspired styling */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .user-info .username {
    font-weight: 500;
    color: #ecf0f1;
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 999;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #34495e;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-menu a:hover, .nav-menu a.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-left-color: #e74c3c;
    transform: translateX(5px);
}

.nav-menu .icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: 250px;
    margin-top: 60px;
    padding: 30px;
    min-height: calc(100vh - 60px);
}

/* Cards */
.card {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card h2, .card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.table td {
    padding: 15px 12px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

/* Status badges */
.status {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.running { background: #2ecc71; color: white; }
.status.stopped { background: #e74c3c; color: white; }
.status.paused { background: #f39c12; color: white; }
.status.unknown { background: #95a5a6; color: white; }
.status.active { background: #27ae60; color: white; }
.status.suspended { background: #e67e22; color: white; }

/* Interactive status transitions */
.status.transitioning { 
    background: linear-gradient(90deg, #3498db, #2980b9); 
    color: white;
    animation: pulse 1.5s infinite;
}
.status.error { background: #e74c3c; color: white; }

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

/* Pagination styles */
.pagination {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination .btn {
    min-width: 80px;
    margin: 0;
}

.pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-weight: 500;
    color: #34495e;
    margin: 0 15px;
}

/* Bulk actions panel */
#bulk-actions-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#bulk-actions-panel .btn {
    position: relative;
    min-width: 120px;
    transition: all 0.3s ease;
}

#bulk-actions-panel .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#bulk-actions-panel .btn:disabled {
    transform: none;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: pointer;
}

input[type="checkbox"]:indeterminate {
    accent-color: #f39c12;
}

/* Button loading states */
.btn[disabled] {
    position: relative;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn[disabled].info {
    cursor: wait !important;
    opacity: 1 !important;
}

/* Success/Error states */
.btn.success {
    animation: successPulse 0.3s ease;
}

.btn.danger {
    animation: errorShake 0.3s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* Table row animations */
tr {
    transition: all 0.3s ease;
}

tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Action buttons container */
td .btn {
    margin: 1px;
    transition: all 0.2s ease;
}

td .btn:hover {
    transform: scale(1.05);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* VNC status */
.vnc-status {
    font-size: 12px;
    font-weight: 600;
}

/* Resource graphs */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 15px;
}

/* Legacy modal - kept for compatibility */

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .nav-container.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 10px 15px;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert.success {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.alert.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.alert.warning {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border-left: 4px solid #f39c12;
}

/* Progress bars for resources */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.warning { background: linear-gradient(90deg, #f39c12, #e67e22); }
.progress-fill.danger { background: linear-gradient(90deg, #e74c3c, #c0392b); }

/* Legacy Modal Styles - kept for compatibility */

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* VM Details Styles */
.resource-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item label {
    min-width: 80px;
    font-weight: 500;
    color: #2c3e50;
}

.stat-item .progress-bar {
    flex: 1;
    margin: 0;
}

.stat-item span {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    color: #2c3e50;
}

.btn .icon {
    margin-right: 8px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tab Container Styles */
.tab-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #555;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-button:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
    color: #3498db;
}

.tab-button.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-color: #2980b9;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Backup Status Styles */
.backup-summary {
    margin-bottom: 20px;
}

.backup-overall-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.backup-overall-status.ok {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #27ae60;
}

.backup-overall-status.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.backup-entry {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.backup-status.success {
    color: #2ecc71;
    font-weight: bold;
}

.backup-status.error {
    color: #e74c3c;
    font-weight: bold;
}

.backup-date {
    font-size: 14px;
    color: #7f8c8d;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.backup-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.backup-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.backup-detail label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
}

.backup-detail code {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #3498db;
}

.backup-frequency {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.backup-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.loading-spinner::before {
    content: "⏳";
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Backup Icon Styles */
.backup-icon {
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: inline-block;
}

.backup-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.backup-icon.loading {
    animation: spin 1s linear infinite;
}

.backup-icon.ok {
    color: #2ecc71;
}

.backup-icon.error {
    color: #e74c3c;
}

.backup-icon.no-backup {
    color: #f39c12;
}

/* IP Pool Management Styles */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.allocated {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.status-badge.free {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.stat-card h3 {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.stat-card p {
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

/* Modal Overlay for plan creation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-overlay .modal {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #95a5a6;
    cursor: pointer;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* Base Modal Class */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

/* Blocked Status Badge */
.status-badge.blocked {
    background-color: #f39c12;
    color: white;
    font-weight: 500;
}

/* IP Checkbox Styling */
.ip-checkbox {
    margin-right: 8px;
}
/* Nested Menu Styles */
.menu-section {
    border-bottom: 1px solid rgba(52, 73, 94, 0.1);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #34495e;
    background: rgba(52, 73, 94, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    border-left: 3px solid transparent;
}

.menu-header:hover {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
}

.menu-header.expanded {
    background: rgba(52, 152, 219, 0.15);
    border-left-color: #2980b9;
    color: #2980b9;
}

.menu-header .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.submenu {
    list-style: none;
    background: rgba(236, 240, 241, 0.5);
    display: block;
}

.submenu li {
    border-left: 3px solid transparent;
}

.submenu a {
    padding: 10px 20px 10px 40px;
    font-size: 14px;
    color: #7f8c8d;
    border-left: none;
    background: none;
}

.submenu a:hover, .submenu a.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateX(8px);
    border-left: none;
}

.submenu .icon {
    margin-right: 8px;
    font-size: 14px;
    width: 16px;
}


/* Import VM styling */
.vm-card.imported {
    background: rgba(220, 252, 231, 0.9);
    border: 2px solid #16a085;
}

.import-status {
    padding: 10px;
    text-align: center;
    color: #16a085;
    font-weight: bold;
    font-size: 14px;
    background: rgba(22, 160, 133, 0.1);
    border-radius: 4px;
    margin: 5px 0;
}

.vm-card.imported .vm-card-header {
    background: rgba(22, 160, 133, 0.1);
}

