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

:root {
    --primary-color: #0066ff;
    --primary-dark: #0052cc;
    --primary-light: #3385ff;
    --secondary-color: #00ccff;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success: #00cc66;
    --warning: #ffaa00;
    --danger: #ff3366;
    --border: #333333;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #000510 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== MODERN CUSTOM CHECKBOX ==================== */

/* Hide default checkbox visually but keep it accessible */
input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    margin: 0;
    z-index: -1;
}

/* Style for label that wraps checkbox - use span inside for text */
label:has(> input[type="checkbox"]) {
    position: relative;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    padding-left: 32px;
    min-height: 24px;
}

/* Disable default checkbox styling for custom account cards */
label.linode-account-card {
    padding-left: 0 !important;
}

label.linode-account-card::before,
label.linode-account-card::after {
    display: none !important;
}

/* Disable default checkbox styling for toggle switches */
label.toggle-switch {
    padding-left: 0 !important;
}

label.toggle-switch::before,
label.toggle-switch::after {
    display: none !important;
}

/* Create custom checkbox box - only on label that directly contains input (not toggle-switch) */
label:has(> input[type="checkbox"]):not(.toggle-switch)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state */
label:has(> input[type="checkbox"]:hover):not(.toggle-switch)::before {
    border-color: var(--primary-light);
    background: rgba(0, 102, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* Focus state for accessibility */
label:has(> input[type="checkbox"]:focus):not(.toggle-switch)::before {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.2);
}

/* Checked state - checkbox box */
label:has(> input[type="checkbox"]:checked):not(.toggle-switch)::before {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

/* Create checkmark */
label:has(> input[type="checkbox"]):not(.toggle-switch)::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg) scale(0);
    width: 5px;
    height: 10px;
    border: solid transparent;
    border-width: 0 2.5px 2.5px 0;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show checkmark when checked */
label:has(> input[type="checkbox"]:checked):not(.toggle-switch)::after {
    border-color: white;
    transform: translateY(-50%) rotate(45deg) scale(1);
    opacity: 1;
    animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Checkmark animation */
@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) rotate(45deg) scale(1.2);
    }
    100% {
        transform: translateY(-50%) rotate(45deg) scale(1);
        opacity: 1;
    }
}

/* Disabled state */
label:has(> input[type="checkbox"]:disabled)::before {
    background: var(--surface-light);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

label:has(> input[type="checkbox"]:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== END CUSTOM CHECKBOX ==================== */

/* Page Management */
.page {
    display: flex;
    min-height: 100vh;
}

.page.hidden {
    display: none;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    margin: auto;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 102, 255, 0.3), 0 0 100px rgba(0, 204, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.3);
    max-width: 450px;
    width: 90%;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2), 0 0 20px rgba(0, 102, 255, 0.1);
    transform: translateY(-1px);
}

.form-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ==================== MODERN BUTTONS (2025 Design) ==================== */

/* Base Button - Smaller, cleaner */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Primary Button - Solid, modern */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 102, 255, 0.3);
}

/* Ghost Button - Outline style for secondary actions */
.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2);
}

/* Icon Button - Small, icon-only */
.btn-icon {
    padding: 0.5rem;
    min-width: 2rem;
    min-height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.15);
}

/* Secondary Button */
.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

/* Success Button */
.btn-success {
    background: #00cc66;
    color: white;
    border: 1px solid transparent;
}

.btn-success:hover {
    background: #00aa55;
    box-shadow: 0 4px 12px rgba(0, 204, 102, 0.4);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: #cc0044;
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: #000;
    border: 1px solid transparent;
}

.btn-warning:hover {
    background: #ff9500;
    box-shadow: 0 4px 12px rgba(255, 170, 0, 0.4);
}

/* Small Button */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Disabled state */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.error-message {
    color: var(--danger);
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ==================== DASHBOARD LAYOUT ==================== */
#dashboard {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 102, 255, 0.2);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-brand i {
    font-size: 1.8rem;
}

.brand-text {
    transition: opacity 0.3s, width 0.3s;
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    padding-bottom: 6rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    margin: 0.25rem 0;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.nav-item i {
    font-size: 1.25rem;
    min-width: 24px;
}

.nav-text {
    transition: opacity 0.3s, width 0.3s;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(0, 102, 255, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* Submenu Navigation */
.nav-item-group {
    position: relative;
}

.nav-item-parent {
    position: relative;
    justify-content: space-between;
}

.nav-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-item-group.open .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-item-group.open .nav-submenu {
    max-height: 600px; /* Increased for more items */
}

.nav-subitem {
    padding-left: 3.5rem;
    font-size: 0.9rem;
    border-left-width: 3px;
}

.nav-subitem i {
    font-size: 1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid rgba(255, 51, 102, 0.2);
    background: rgba(10, 10, 10, 0.95);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 51, 102, 0.05);
    color: var(--danger);
    border: 1px solid rgba(255, 51, 102, 0.2);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.logout-btn i {
    font-size: 1.2rem;
}

.logout-btn:hover {
    background: rgba(255, 51, 102, 0.15);
    border-left-color: var(--danger);
    border-color: rgba(255, 51, 102, 0.4);
    transform: translateX(3px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 102, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
}

.top-bar-actions {
    display: flex;
    gap: 0.5rem;
}

/* Icon buttons in topbar - using .btn-icon class defined above */

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Glass Card - Glassmorphism Effect */
.glass-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s;
}

.view.active {
    display: block;
}

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

/* ==================== VIEW HEADERS (Modern Minimal) ==================== */

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.view-header > div {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.view-header .btn,
.view-header button {
    width: auto;
    min-width: auto;
}

/* ==================== SERVERS SEARCH ==================== */

.servers-search-wrapper {
    position: relative;
    max-width: 500px;
}

.servers-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}

.servers-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.servers-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.servers-search-input::placeholder {
    color: var(--text-secondary);
}

.servers-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.servers-search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.servers-search-clear.hidden {
    display: none;
}

/* Servers Grid */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.server-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.server-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.3);
    transform: translateY(-5px);
}

.server-card.hidden-search {
    display: none;
}

/* Panel Created Badge */
.panel-created-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 0.4rem;
    margin-left: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    animation: badgeFadeIn 0.3s ease-out;
}

.panel-created-badge i {
    font-size: 0.65rem;
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Create Server Card */
.create-server-card {
    background: rgba(0, 102, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px dashed rgba(0, 102, 255, 0.3);
    border-radius: 1rem;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 300px;
    cursor: pointer;
    transition: all 0.3s;
}

.create-server-card:hover {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.3);
    transform: translateY(-5px);
}

.create-server-card i {
    font-size: 4rem;
    color: var(--primary-color);
    transition: all 0.3s;
}

.create-server-card:hover i {
    transform: scale(1.1);
}

.create-server-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.create-server-card p {
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 102, 255, 0.1);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 102, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.profile-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.3);
    transform: translateY(-5px);
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-info {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.profile-info-item i {
    color: var(--primary-color);
    width: 16px;
}

.profile-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.quick-label-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.quick-label-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.server-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.server-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.server-status.running {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success);
}

.server-status.offline {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger);
}

.server-info {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.server-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.server-info-item i {
    color: var(--primary-color);
    width: 1rem;
}

.server-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 102, 255, 0.1);
}

.action-btn {
    padding: 0.5rem;
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 255, 0.2);
    transform: translateY(-2px);
}

/* Terminal Layout */
.terminal-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: calc(100vh - var(--topbar-height) - 8rem);
}

.terminal-sidebar {
    overflow-y: auto;
}

.terminal-main {
    overflow: hidden;
}

.terminal-card {
    height: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.terminal-header {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 100;
    display: flex;
    gap: 0.5rem;
}

/* Terminal header icon buttons - using .btn-icon class */
.terminal-header .btn-icon {
    background: rgba(0, 102, 255, 0.15);
    border-color: rgba(0, 102, 255, 0.25);
    color: var(--primary-color);
}

.terminal-header .btn-icon:hover {
    background: rgba(0, 102, 255, 0.25);
    border-color: var(--primary-color);
}

/* Fullscreen Mode */
.terminal-card.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

.terminal-card.fullscreen .terminal-header {
    display: none;
}

.fullscreen-exit {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    background: rgba(255, 51, 102, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border: 2px solid var(--danger);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 51, 102, 0.4);
}

.fullscreen-exit:hover {
    background: var(--danger);
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 51, 102, 0.6);
}

.fullscreen-exit.hidden {
    display: none;
}

#terminal {
    height: 100%;
    padding: 1rem;
}

.xterm {
    height: 100% !important;
}

.xterm-viewport {
    background-color: transparent !important;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.button-group .btn {
    flex: 1;
    min-width: 150px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(0, 102, 255, 0.2);
    color: var(--primary-color);
    border: 1px solid rgba(0, 102, 255, 0.3);
}

.badge-success {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success);
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.badge-danger {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

/* API Settings */
.settings-description {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.settings-description a {
    color: var(--primary-color);
    text-decoration: none;
}

.settings-description a:hover {
    text-decoration: underline;
}

.api-status {
    background: rgba(42, 42, 42, 0.5);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 102, 255, 0.2);
}

.api-status.success {
    border-color: var(--success);
    background: rgba(0, 204, 102, 0.1);
}

.api-status.error {
    border-color: var(--danger);
    background: rgba(255, 51, 102, 0.1);
}

.api-status .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.api-status .status-label {
    color: var(--text-secondary);
}

.api-status .status-value {
    color: var(--text-primary);
    font-weight: 500;
}

.api-status .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.api-status .status-badge.valid {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success);
}

.api-status .status-badge.invalid {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger);
}

.settings-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 102, 255, 0.1);
}

.settings-info h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.settings-info ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.settings-info ol li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.settings-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.settings-info a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    min-width: 500px;
    max-width: 90%;
    max-height: 90vh;
    z-index: 1001;
    margin: 0 auto;
}

/* Modal scrollbar positioning - closer to right edge */
.modal-content::-webkit-scrollbar-track {
    margin: 0;
}

/* Remove height limit for execution terminal modal */
.execution-terminal-modal .modal-content {
    max-height: none;
    overflow-y: visible;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.2);
    color: var(--danger);
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(255, 51, 102, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    /* Dynamic content */
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Modal adjustments for collapsed sidebar - no longer needed as modal covers full screen */

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .terminal-layout {
        grid-template-columns: 1fr;
    }

    .terminal-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
    }

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

    .mobile-menu-btn {
        display: block;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .servers-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        min-width: 90%;
    }

    .modal {
        left: 0;
        width: 100%;
    }

    .modal-overlay {
        left: 0;
        width: 100%;
    }

    .view-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .view-header .btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    margin: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 255, 0.3);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 102, 255, 0.5);
    background-clip: content-box;
}

/* ==================== SCRIPTS VIEW ==================== */

.scripts-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - var(--topbar-height) - 120px);
    min-height: 600px;
}

/* Script Library Sidebar */
.scripts-sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.scripts-sidebar-header {
    margin-bottom: 1rem;
}

.scripts-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.script-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.script-search-input::placeholder {
    color: var(--text-secondary);
}

/* Script Categories */
.script-category {
    margin-bottom: 1.5rem;
}

.script-category-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
}

.script-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Script Card (Draggable) */
.script-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.script-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.script-card:active {
    cursor: grabbing;
}

.script-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.script-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.script-card-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.script-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.script-card-badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
    border-radius: 0.25rem;
}

.script-card-description {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    opacity: 0.85;
}

/* Generic description styling - can be used anywhere */
.item-description,
.profile-description,
.upload-description {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.85;
    line-height: 1.5;
    margin: 0.5rem 0;
}

/* Scripts Main Canvas */
.scripts-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.scripts-canvas-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.scripts-canvas-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hint-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.scripts-server-canvas {
    flex: 1;
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative; /* For cross-fade positioning */
}

.scripts-server-canvas.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 102, 255, 0.05);
}

.scripts-server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    /* Smooth transition for content updates */
    will-change: contents;
}

/* Script Server Card (Drop Target) */
.script-server-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    padding: 1rem;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.script-server-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.script-server-card.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 102, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.3);
}

.script-server-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.script-server-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 0.625rem;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.script-server-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 48px;
}

.script-server-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.script-server-ip {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    line-height: 1.3;
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ip-copy-btn {
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}

.ip-copy-btn:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: scale(1.1);
}

.script-server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(0, 204, 102, 0.15);
    color: var(--success);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.script-server-status.offline {
    background: rgba(255, 51, 102, 0.15);
    color: var(--danger);
}

/* Server Status Group (online + iran ping) */
.script-server-status-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: flex-end;
}

.script-server-iran-ping {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.script-server-iran-ping:hover {
    background: rgba(255, 165, 0, 0.25);
    transform: scale(1.05);
}

.script-server-iran-ping.ping-checking {
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-color);
}

.script-server-iran-ping.ping-success {
    background: rgba(0, 255, 102, 0.15);
    color: #00ff66;
}

.script-server-iran-ping.ping-partial {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
}

.script-server-iran-ping.ping-fail {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
}

.script-server-iran-ping i {
    font-size: 0.65rem;
}

.script-server-details {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.script-server-detail {
    flex: 1;
}

.script-server-detail-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.script-server-detail-value {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Drop Indicator */
.drop-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 255, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 0.875rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    pointer-events: none;
}

.script-server-card.drag-over .drop-indicator {
    display: flex;
}

/* Script Actions in View Header */
.script-actions {
    display: flex;
    gap: 0.5rem;
}

/* Category collapse/expand */
.script-category-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.script-category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.script-category-toggle {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.script-category.collapsed .script-category-toggle {
    transform: rotate(-90deg);
}

.script-category.collapsed .script-list {
    display: none;
}

/* Server card installed scripts badges */
.script-server-installed {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.script-installed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 102, 255, 0.15);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 0.375rem;
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 500;
}

.script-installed-badge i {
    font-size: 0.65rem;
}

/* Running execution indicator */
.script-running-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 204, 102, 0.2);
    border: 2px solid var(--success);
    border-radius: 50%;
    cursor: pointer;
    animation: pulse 2s infinite;
    z-index: 10;
}

.script-running-indicator i {
    color: var(--success);
    font-size: 0.875rem;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 204, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 204, 102, 0);
    }
}

/* Modal scroll improvements */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.75rem;
}

/* Remove height limit for execution terminal modal */
.execution-terminal-modal .modal-body {
    max-height: none;
    overflow-y: visible;
}

.execution-output-container {
    position: relative;
    max-height: 500px;
    overflow-y: auto;
    background: #000;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.execution-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add category button */
.script-category-add {
    padding: 0.5rem;
    background: rgba(0, 102, 255, 0.1);
    border: 1px dashed rgba(0, 102, 255, 0.3);
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.875rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.script-category-add:hover {
    background: rgba(0, 102, 255, 0.15);
    border-color: var(--primary-color);
}

/* ==================== ICON PICKER ==================== */

.icon-picker-container {
    max-width: 600px;
    margin: 0 auto;
}

.icon-picker-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.icon-picker-tab {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-transform: capitalize;
}

.icon-picker-tab:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.icon-picker-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.icon-picker-grid {
    position: relative;
    min-height: 300px;
}

.icon-picker-category {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
}

.icon-picker-category.active {
    display: grid;
}

.icon-picker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
}

.icon-picker-item:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.icon-picker-item i {
    color: var(--primary-color);
}

/* ==================== COLOR PICKER ==================== */

.color-picker-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.color-picker-item {
    aspect-ratio: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

.color-picker-item:hover {
    transform: scale(1.05);
    border-color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.color-picker-label {
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 0.875rem;
}

/* ==================== CATEGORY MANAGEMENT ==================== */

.script-category-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.script-category-header:hover .script-category-actions {
    opacity: 1;
}

.script-category-action-btn {
    padding: 0.25rem 0.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.script-category-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.script-category-action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ==================== SCRIPT CRUD ==================== */

.script-form-grid {
    display: grid;
    gap: 1rem;
}

.script-icon-color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.script-icon-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.script-icon-preview:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
}

.script-icon-preview i {
    font-size: 2rem;
}

.script-color-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.script-color-preview:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
}

.script-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    border: 2px solid var(--border);
}

/* ==================== COLLAPSE/EXPAND ALL BUTTON ==================== */

.scripts-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 0.5rem;
}

.btn-collapse-all {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-collapse-all:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.scripts-search-wrapper {
    flex: 1;
    position: relative;
}

/* ==================== INSTALLED SCRIPTS IMPROVEMENTS ==================== */

.script-server-installed {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.installed-scripts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.installed-scripts-header:hover {
    background: rgba(0, 102, 255, 0.1);
}

.installed-scripts-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.installed-scripts-toggle {
    transition: transform 0.2s;
}

.installed-scripts-header.collapsed .installed-scripts-toggle {
    transform: rotate(-90deg);
}

.installed-scripts-list {
    display: grid;
    gap: 0.5rem;
}

.installed-scripts-header.collapsed + .installed-scripts-list {
    display: none;
}

.script-installed-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 102, 255, 0.15);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s;
}

.script-installed-badge:hover {
    background: rgba(0, 102, 255, 0.25);
    border-color: var(--primary-color);
}

.installed-script-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.installed-script-remove {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
    opacity: 0.6;
}

.installed-script-remove:hover {
    opacity: 1;
    background: rgba(255, 51, 102, 0.2);
}

/* ==================== GLOBAL SCRIPT ACTIONS ==================== */

.scripts-global-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-toggle-all-scripts {
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-toggle-all-scripts:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== SCRIPT CARD ENHANCEMENTS ==================== */

.script-card {
    position: relative;
}

.script-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.script-card:hover .script-card-actions {
    opacity: 1;
}

.script-card-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.script-card-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.script-card-action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .scripts-layout {
        flex-direction: column;
        height: auto;
    }

    .scripts-sidebar {
        width: 100%;
        max-height: 400px;
    }

    .scripts-server-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .icon-picker-category {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .color-picker-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .script-icon-color-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Running Scripts Section ===== */

.server-running-scripts-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.running-scripts-header {
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 165, 0, 0.05);
    user-select: none;
}

.running-scripts-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.running-scripts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.running-script-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 165, 0, 0.05);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-left: 3px solid #ffa500;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.running-script-item:hover {
    background: rgba(255, 165, 0, 0.1);
    border-left-width: 4px;
}

.running-script-item i:first-child {
    font-size: 1rem;
}

.running-script-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.running-script-status {
    font-size: 0.75rem;
    color: #ffa500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== Improved Installed Scripts Section ===== */

.server-installed-scripts-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.installed-scripts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.installed-scripts-header:hover {
    background: rgba(0, 102, 255, 0.05);
}

.installed-scripts-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.installed-scripts-toggle {
    font-size: 0.75rem;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.installed-scripts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.installed-scripts-list.collapsed {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
}

.installed-script-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.installed-script-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-width: 4px;
}

.installed-script-item i:first-child {
    font-size: 1rem;
}

.installed-script-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.installed-script-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.75rem;
    padding: 0;
}

.installed-script-remove:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* ===== Live SSH Terminal for Script Execution ===== */

.execution-terminal-container {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

/* Fullscreen mode for execution terminal */
.execution-terminal-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    border-radius: 0;
    margin: 0;
    border: none;
}

.execution-terminal-container.fullscreen #execution-terminal {
    height: 100vh !important;
}

/* Hide modal overlay and content when terminal is fullscreen */
.modal:has(.execution-terminal-container.fullscreen) .modal-overlay {
    display: none;
}

.modal:has(.execution-terminal-container.fullscreen) .modal-content {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.fullscreen-exit-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    background: rgba(255, 51, 102, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border: 2px solid var(--danger);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 51, 102, 0.4);
}

.fullscreen-exit-btn:hover {
    background: var(--danger);
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 51, 102, 0.6);
}

.fullscreen-exit-btn.hidden {
    display: none;
}

.execution-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.execution-status-badge i {
    font-size: 1rem;
}

.execution-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

/* ===== Script Editor Modal ===== */

.script-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
}

.script-editor-modal {
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.script-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.script-editor-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.script-editor-header h3 i {
    color: #00ff00;
}

.script-editor-body {
    flex: 1;
    padding: 1.5rem;
    overflow: hidden;
    background: #0a0a0a;
}

.script-editor-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #0a0a0a;
    color: #00ff00;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.script-editor-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.1);
}

.script-editor-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
}

/* ==================== FAILED SCRIPTS SECTION ==================== */

.server-failed-scripts-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.failed-scripts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.failed-scripts-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.failed-scripts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.failed-script-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-left: 3px solid #ff4444;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.failed-script-item:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.5);
}

.failed-script-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
}

.failed-script-name {
    font-weight: 500;
    color: var(--text-primary);
    flex-shrink: 0;
}

.failed-script-error {
    font-size: 0.8rem;
    color: #ff4444;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.failed-script-view {
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    border: none;
    border-radius: 0.25rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.failed-script-view:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.failed-script-view:active {
    transform: translateY(0);
}

/* ==================== DEPLOYMENT STATUS BADGES ==================== */

.deployment-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-not_deployed {
    background: rgba(160, 160, 160, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 160, 160, 0.3);
}

.status-deploying {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.status-deployed {
    background: rgba(0, 204, 102, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.status-failed {
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.deployment-status i {
    font-size: 0.9rem;
}

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

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.2);
}

.server-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.server-details div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-details i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

/* ==================== DOMAIN MANAGEMENT STYLES ==================== */

.domain-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.domain-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.domain-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2), 0 0 20px rgba(0, 102, 255, 0.1);
    transform: translateY(-1px);
}

.cloudflare-account-select {
    width: 180px;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cloudflare-account-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2), 0 0 20px rgba(0, 102, 255, 0.1);
    transform: translateY(-1px);
}

.primary-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
}

.btn-remove-domain {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.btn-remove-domain:hover:not(:disabled) {
    background: #ff1744;
    transform: scale(1.05);
}

.btn-remove-domain:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#add-domain-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.primary-indicator {
    font-size: 0.85rem;
}

.server-domains {
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
}

.server-domains .domain-badge {
    border: 1px solid rgba(0, 102, 255, 0.3);
}

/* Iran Servers Styles */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-rebooting {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-unknown {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.iran-server-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.iran-server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.15);
}

.btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-width: auto;
}

/* Profiles Hub Styles */
.profiles-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.profile-hub-card {
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.profile-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 102, 255, 0.25);
    border-color: rgba(0, 102, 255, 0.3);
}

.profile-hub-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.profile-hub-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-hub-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-hub-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    min-height: 2.8em;
    /* Always reserve space for 2 lines (line-height 1.4 * 2 = 2.8em) */
}

.profile-hub-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    /* margin-top: auto pushes this to bottom in flex container */
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-hub-arrow {
    font-size: 1rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.profile-hub-card:hover .profile-hub-arrow {
    transform: translateX(4px);
}

/* Responsive for Profiles Hub */
@media (max-width: 768px) {
    .profiles-hub-grid {
        grid-template-columns: 1fr;
    }

    .profile-hub-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* ==================== BREADCRUMB NAVIGATION ==================== */
.breadcrumb {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.breadcrumb-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.breadcrumb-item:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.5;
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 0.75rem 1rem;
    }

    .breadcrumb-items {
        font-size: 0.85rem;
    }
}

/* AI Badge for Scripts */
.script-card-badge.ai-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.script-card-badge.super-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.script-card-action-btn.ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.script-card-action-btn.ai:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.1);
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.3);
}

.toggle-slider:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.toggle-switch input:checked + .toggle-slider:hover {
    background-color: var(--primary-dark);
}

/* ==================== Script Version History ==================== */

.version-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.version-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 102, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.version-info {
    flex: 1;
}

.version-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.version-number i {
    color: var(--primary-color);
}

.version-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.version-badge.archived {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.version-badge.auto {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.version-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.version-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.version-meta i {
    font-size: 12px;
}

.version-description {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.version-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.btn-icon.restore:hover {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    border-color: #00c851;
    color: white;
}

#version-list-loading,
#version-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

#version-list-loading i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

#version-list-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.2);
}

/* Version Code Viewer */
#version-code-viewer-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#version-code-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 60vh;
    overflow-y: auto;
}

.version-code-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* Script Actions with Version Buttons */
.script-version-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-version {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-version:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-version i {
    font-size: 12px;
}

.btn-version.history {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.btn-version.history:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-version.save {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    border-color: rgba(0, 200, 81, 0.3);
}

.btn-version.save:hover {
    box-shadow: 0 4px 12px rgba(0, 200, 81, 0.3);
}

.btn-version.archive {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: rgba(243, 156, 18, 0.3);
}

.btn-version.archive:hover {
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

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