/* WordPress Multi-Server Dashboard Styles */

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #343a40 0%, #495057 100%);
    box-shadow: 2px 0 4px rgba(0,0,0,.1);
}

.sidebar .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
    font-weight: 500;
}

/* Main Content */
.main-content {
    background-color: var(--light-color);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0,0,0,.1);
    font-weight: 600;
}

/* Server Cards */
.server-card {
    transition: all 0.3s ease;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
}

.server-card .card-title {
    color: var(--dark-color);
    font-weight: 600;
}

/* Status Indicators */
.status-active { 
    color: var(--success-color); 
}

.status-inactive { 
    color: #6c757d; 
}

.status-error { 
    color: var(--danger-color); 
}

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Loading Styles */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Statistics Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.stats-card .card-body {
    position: relative;
    overflow: hidden;
}

.stats-card .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

/* Login Modal */
#loginModal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

#loginModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
}

/* Form Styles */
.form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Navigation Breadcrumb */
.page-breadcrumb {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Activity Timeline */
.activity-item {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: white;
    }
    
    .main-content {
        background-color: #1a202c;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

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

/* Server Management Styles */
.server-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,.125);
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,.15);
    border-color: var(--primary-color);
}

.server-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0,0,0,.125);
    font-weight: 600;
}

.server-card .server-info {
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.server-card .btn-group .btn {
    flex: 1;
    font-size: 0.8rem;
}

.server-card .btn-group .btn i {
    font-size: 0.9rem;
}

/* Modal Enhancements */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Ensure alerts appear above modals */
.alert {
    z-index: 1060;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-label {
    font-weight: 600;
    color: var(--dark-color);
}

.modal-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Modal-specific alerts */
.modal .alert {
    margin-bottom: 1rem;
    z-index: 1070;
}

/* Status Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Server Details Modal */
#serverDetailsModal .table td {
    border: none;
    padding: 0.25rem 0.5rem;
}

#serverDetailsModal .table td:first-child {
    width: 40%;
    color: var(--dark-color);
}

/* API Key Display */
.font-monospace {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* Loading States */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn .fas.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Server Status Indicators */
.text-online { color: #28a745 !important; }
.text-offline { color: #dc3545 !important; }
.text-inactive { color: #ffc107 !important; }

/* Responsive Improvements */
@media (max-width: 768px) {
    .server-card .btn-group {
        flex-direction: column;
    }
    
    .server-card .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.375rem !important;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
}

/* Add server empty state */
.empty-state {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.empty-state:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.empty-state i {
    opacity: 0.7;
    margin-bottom: 1rem;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}