/* Container Cards */
.container-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.container-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08);
}

.db-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.8;
}

/* Modals */
.glass-modal {
    background: #ffffff !important;
    border-radius: 1.5rem;
    box-shadow: 0 40px 60px -15px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

.modal-header {
    border-bottom: 1px solid #f1f5f9 !important;
}

.modal-content {
    border: none !important;
}

/* Nav Pills */
.nav-pills .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.6rem 1.75rem;
    border-radius: 50px;
    transition: all 0.2s;
}

.nav-pills .nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group-text {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #94a3b8 !important;
}

.file-list-container {
    margin-bottom: 1.5rem;
}

/* Backup Table Styles */
.table-container {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
}

.backup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-dark {
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-main) !important;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc !important;
}

.table th {
    background: #f8fafc !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 600;
}

/* Stepper Styles */
.step-item {
    text-align: center;
    width: 33.33%;
    z-index: 2;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.3s;
    border: 2px solid #e2e8f0;
}

.step-item.active .step-icon {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.step-item.completed .step-icon {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.step-item.active .step-label {
    color: var(--text-main);
}

.step-line {
    position: absolute;
    top: 20px;
    left: 16.66%;
    right: 16.66%;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.backup-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn.small {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
}

/* Messages */
.empty-msg {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    display: none;
}

.empty-msg.show {
    display: block;
}

.status-msg {
    margin-top: 1.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    display: none;
}

.status-msg.show {
    display: block;
}

.status-msg.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-msg.info {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-main);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    transform: translateY(200%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#loading-overlay.d-none {
    display: none !important;
}

.loader-content {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pulsing-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Preview Instance Rows (Nested) */
.preview-instance-row {
    background-color: #f8fafc !important;
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}

.preview-instance-row:hover {
    background-color: #f1f5f9 !important;
}

.preview-instance-row td {
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

/* Sidebar Custom Styles */
.sidebar {
    width: 280px;
    min-width: 280px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        z-index: 2000;
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.2) !important;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    #main-content-area {
        width: 100% !important;
        min-width: 100%;
        margin-left: 0 !important;
    }


    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
}


.sidebar-link {
    transition: all 0.2s;
    color: var(--text-muted);
}

.sidebar-link:hover {
    background-color: var(--bg-light) !important;
    color: var(--primary);
    transform: translateX(4px);
}

.sidebar-link.active {
    background-color: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
    border-right: 3px solid var(--primary) !important;
    border-radius: 0.5rem 0 0 0.5rem !important;
}

/* Admin Panes Content Styling */
#admin-panes-container .card-body {
    min-height: calc(100vh - 200px);
}

/* Custom Scrollbar for Sidebar */
.sidebar .overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.sidebar .overflow-auto::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .overflow-auto::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.sidebar .overflow-auto:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
}

/* Custom Tabs for Main Content */
.custom-tab {
    color: var(--text-muted) !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 1rem 1.5rem !important;
    margin-bottom: -1px;
    border-radius: 0 !important;
    transition: all 0.2s;
}

.custom-tab:hover {
    color: var(--primary) !important;
    border-bottom-color: rgba(99, 102, 241, 0.3) !important;
}

.custom-tab.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
    background: transparent !important;
}

/* Cursor Utilities */
.cursor-pointer {
    cursor: pointer !important;
}
/* Terminal Styles */
.terminal-container {
    background-color: #0c0c0c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New', monospace !important;
}

#terminal-xterm-container {
    width: 100%;
    height: 100%;
    font-family: inherit !important;
}

.xterm-rows {
    font-family: inherit !important;
}


.xterm {
    padding: 12px;
}

.xterm-viewport::-webkit-scrollbar {
    width: 10px;
}

.xterm-viewport::-webkit-scrollbar-track {
    background: #0c0c0c;
}

.xterm-viewport::-webkit-scrollbar-thumb {
    background: #2d2d2d;
    border-radius: 10px;
}

.xterm-viewport::-webkit-scrollbar-thumb:hover {
    background: #404040;
}

.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* Mobile Adjustments */
@media (max-width: 575.98px) {
    .h3, h3 {
        font-size: 1.25rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Fix giant sticky bar buttons */
    #main-content-area > .position-sticky {
        position: relative !important;
        background: white !important;
        padding: 1rem !important;
        justify-content: center !important;
        margin-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }
}

