/* Root Variables for Dark Theme Design System */
:root {
    --bg-app: #090a0f;
    --bg-sidebar: rgba(15, 17, 26, 0.7);
    --bg-card: rgba(22, 25, 38, 0.6);
    --bg-surface: #161926;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.1);
    --warning: #f59e0b;

    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-area h2 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-area span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: white;
    background-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-online {
    color: var(--success);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-online .dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-app);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 40px;
}

.header-title h1 {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Tab Content management */
.tab-content {
    display: none;
    padding: 0 40px 40px 40px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.icon-purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-info h3 {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Layout containers */
.section-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.panel-header h2 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* Tables */
.list-wrapper {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-secondary);
}

.custom-table tr:hover td {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.02);
}

/* Badge classes */
.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: #ef4444;
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.badge-dark {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

/* Double Panel layouts */
.panel-grid-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.dual-columns {
    display: flex;
    gap: 24px;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

/* Custom Form Styles */
.custom-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.flex-2 {
    flex: 2;
}

.form-group.flex-1 {
    flex: 1;
}

.custom-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.custom-form input[type="text"],
.custom-form input[type="password"],
.custom-form input[type="number"],
.custom-form select,
.custom-form textarea {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.custom-form select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}


.custom-form input:focus,
.custom-form select:focus,
.custom-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(0, 0, 0, 0.04);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Modal Backgrop & Card styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--info);
}

/* Spin animation for icons */
.spin {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Login Backdrop & Card Styling */
.login-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: var(--transition-smooth);
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.logo-icon-large {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 16px auto;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

.logo-icon-large i {
    width: 32px;
    height: 32px;
}

.login-header h2 {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Password Visibility Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 40px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

.table-search-input {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    width: 220px;
    transition: var(--transition-smooth);
}

.table-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(0, 0, 0, 0.04);
}

.modal-tabs {
    display: flex;
    background-color: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.modal-tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}

.modal-tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

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

.btn-toggle-sidebar {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    width: 38px;
    height: 38px;
    padding: 0;
    transition: var(--transition-smooth);
}

.btn-toggle-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column !important;
        overflow-x: hidden;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        transition: left var(--transition-smooth);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
        display: none;
    }

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

    .btn-toggle-sidebar {
        display: flex !important;
    }

    .top-header {
        padding: 16px !important;
        gap: 16px;
        align-items: center;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }

    .panel {
        margin: 16px !important;
        padding: 16px !important;
    }

    .custom-table {
        font-size: 0.85rem;
    }

    .custom-table th,
    .custom-table td {
        padding: 8px 12px !important;
    }

    /* Hide non-critical columns on tablet/mobile */
    #table-configs th:nth-child(4),
    #table-configs td:nth-child(4),
    /* Username */
    #table-configs th:nth-child(6),
    #table-configs td:nth-child(6)

    /* Schedule */
        {
        display: none;
    }

    #table-logs th:nth-child(2),
    #table-logs td:nth-child(2),
    /* Time */
    #table-logs th:nth-child(5),
    #table-logs td:nth-child(5)

    /* Size */
        {
        display: none;
    }

    .modal-card {
        width: 95% !important;
        margin: 20px auto !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
}

.log-group-header.expanded .toggle-icon {
    transform: rotate(90deg);
}

/* Custom spacing for Docker Projects Table */
#docker-projects-table td {
    padding: 20px 16px;
    vertical-align: middle;
}