/**
 * Custom Styles for CWMKT Server Manager
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Login page styles */
.vh-100 {
    min-height: 100vh;
}

.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Card animations */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Sidebar styles */
.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 1rem 0;
}

.sidebar .nav-link {
    transition: all 0.2s;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    min-width: 20px;
    font-size: 1.1rem;
}

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

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid #0d6efd;
}

/* Modern Breadcrumb Styles */
.modern-breadcrumb {
    margin-bottom: 0;
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef !important;
    padding: 1rem 1.5rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04) !important;
}

.modern-breadcrumb .breadcrumb-item {
    font-size: 0.95rem;
    font-weight: 500;
}

.modern-breadcrumb .breadcrumb-item a {
    color: #6c757d;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.modern-breadcrumb .breadcrumb-item a:hover {
    color: #0d6efd;
    background-color: #e7f1ff;
}

.modern-breadcrumb .breadcrumb-item.active {
    color: #0d6efd !important;
    font-weight: 600;
}

.modern-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.5rem;
    font-weight: 300;
    color: #adb5bd;
    padding: 0 0.75rem;
}

.modern-breadcrumb i {
    font-size: 1rem;
    vertical-align: middle;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 999;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-toggle i {
    font-size: 1.5rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .sidebar-toggle {
        display: none;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* Utility classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Form focus styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button styles */
.btn {
    transition: all 0.2s;
}

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

/* Alert styles */
.alert {
    border-left: 4px solid;
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Main Content with Sidebar */
.content-wrapper,
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding: 0;
    width: calc(100% - 250px);
}

@media (max-width: 767.98px) {
    .content-wrapper,
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-details {
        display: block !important;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

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

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

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

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

/* Avatar styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.avatar-sm {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
}

.avatar-lg {
    width: 80px !important;
    height: 80px !important;
    font-size: 24px !important;
}

.avatar-upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.avatar-upload-zone:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.avatar-upload-zone.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

/* Avatar modal improvements */
.modal-body .avatar-preview {
    border: 3px solid #dee2e6;
    border-radius: 50%;
    transition: border-color 0.3s ease;
}

.modal-body .avatar-preview:hover {
    border-color: #007bff;
}

/* Image crop preview */
.avatar-crop-container {
    max-width: 300px;
    margin: 0 auto;
}

/* User list avatar improvements */
.user-avatar {
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}
