:root {
    /* Dark Mode (Default) */
    --brand-primary: #8A2BE2;
    --brand-secondary: #00E8FC;
    --brand-accent: #F62681;
    --bg-dark: #070d1a;
    --bg-card: #0f1729;
    --bg-element: #1e293b;
    --text-light: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral: #9ca3af;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(138, 43, 226, 0.5);
    --glow-secondary: 0 0 20px rgba(0, 232, 252, 0.5);
    --provider-hetzner: #ff4d6d;
    --provider-contabo: #38bdf8;
    --provider-proxmox: #fbbf24;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

/* Light theme variables */
body.light-theme {
    --brand-primary: #8A2BE2;
    --brand-secondary: #00E8FC;
    --brand-accent: #F62681;
    --bg-dark: #F8F9FC;
    --bg-card: #FFFFFF;
    --bg-element: #F1F5F9;
    --text-light: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --success: #059669;
    --warning: #b45309;
    --error: #b91c1c;
    --neutral: #4b5563;
    --border-color: #E2E8F0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --glow-primary: 0 0 20px rgba(138, 43, 226, 0.1);
    --glow-secondary: 0 0 20px rgba(0, 232, 252, 0.1);
    --provider-hetzner: #e11d48;
    --provider-contabo: #0369a1;
    --provider-proxmox: #b45309;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

button {
    font-family: inherit;
    cursor: pointer;
}

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

/* Side Navigation */
.nav-sidebar {
    width: 280px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.brand-container {
    padding-bottom: 2rem;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.logo-shape {
    position: relative;
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.shape-circle {
    position: absolute;
    border-radius: 50%;
}

.circle-1 {
    width: 30px;
    height: 30px;
    background: var(--brand-primary);
    top: 0;
    left: 0;
    animation: pulse 4s ease-in-out infinite;
}

.circle-2 {
    width: 25px;
    height: 25px;
    background: var(--brand-secondary);
    bottom: 0;
    right: 0;
    animation: pulse 4s ease-in-out infinite alternate;
}

.shape-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(4px);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-3px) translateX(3px); }
    100% { transform: translateY(0) translateX(0); }
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Navigation Sections */
.nav-section {
    margin-bottom: 2rem;
    width: 100%;
}

/* Section divider for nav sections */
.section-divider {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

/* Navigation Menu Items */
.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.menu-link:hover {
    background-color: var(--bg-element);
    color: var(--text-light);
}

.menu-item.active .menu-link {
    background-color: rgba(138, 43, 226, 0.1);
    color: var(--brand-primary);
}

.menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
}

.menu-text {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Organization Selector */
.organization-selector {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-element);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.organization-selector:hover {
    background-color: rgba(138, 43, 226, 0.1);
}

.org-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

.org-details {
    flex: 1;
}

.org-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.125rem;
}

.org-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Light Theme Overrides for Navigation */
body.light-theme .menu-link {
    color: var(--text-secondary);
}

body.light-theme .menu-link:hover {
    background-color: var(--bg-element);
    color: var(--text-light);
}

body.light-theme .menu-item.active .menu-link {
    background-color: rgba(138, 43, 226, 0.1);
    color: var(--brand-primary);
}

body.light-theme .organization-selector {
    background-color: var(--bg-element);
}

body.light-theme .organization-selector:hover {
    background-color: rgba(138, 43, 226, 0.1);
}

/* Navigation Footer */
.nav-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    flex-shrink: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumbs i {
    margin: 0 0.5rem;
    font-size: 0.625rem;
}

.header-actions {
    display: flex;
    align-items: center;
}

.search-bar {
    position: relative;
    margin-right: 1rem;
}

.search-container {
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.875rem;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.action-button {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--bg-element);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.action-button:hover {
    background-color: var(--bg-element-hover);
    color: var(--text-light);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--brand-accent);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-left: 0.5rem;
    border: 2px solid var(--brand-secondary);
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Welcome Panel */
.welcome-panel {
    background: var(--bg-element);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    position: relative;
    overflow: hidden;
}

.welcome-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.welcome-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.welcome-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: var(--bg-element);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(138, 43, 226, 0.1);
}

/* Action buttons in header */
.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--brand-primary);
}

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

.stat-title {
    font-weight: 600;
    color: var(--text-muted);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--bg-element);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-secondary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--error);
}

.stat-breakdown {
    font-size: 0.875rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.item-label {
    color: var(--text-muted);
}

.item-value {
    font-weight: 600;
}

.stat-chart {
    margin-top: 1rem;
}

.chart-item {
    margin-bottom: 0.75rem;
}

.chart-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.chart-bar {
    height: 8px;
    background-color: var(--bg-element);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    text-align: right;
    font-size: 0.75rem;
    color: white;
    padding-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Management Section */
.management-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.view-options {
    display: flex;
    background-color: var(--bg-element);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.view-option {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.view-option:hover {
    color: var(--text-light);
}

.view-option.active {
    background-color: var(--bg-element-hover);
    color: var(--brand-secondary);
}

/* Server Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.server-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.server-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--brand-primary);
}

.card-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.server-info {
    display: flex;
    flex-direction: column;
}

.server-name {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.server-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.server-status.running {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.server-status.stopped {
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--neutral);
}

.server-actions {
    display: flex;
}

.menu-trigger {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background-color: var(--bg-element);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.menu-trigger:hover {
    background-color: var(--bg-element-hover);
    color: var(--text-light);
}

.card-body {
    padding: 1.25rem;
}

.provider-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.provider-badge.hetzner {
    background-color: rgba(255, 77, 109, 0.2);
    color: var(--provider-hetzner);
}

.provider-badge.contabo {
    background-color: rgba(55, 189, 248, 0.2);
    color: var(--provider-contabo);
}

.provider-badge.proxmox {
    background-color: rgba(251, 191, 36, 0.2);
    color: var(--provider-proxmox);
}

.provider-badge i {
    margin-right: 0.5rem;
}

.server-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.spec {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.spec i {
    margin-right: 0.5rem;
    color: var(--text-muted);
}

.server-meta {
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    margin-bottom: 0.5rem;
}

.meta-label {
    width: 80px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.meta-value {
    font-size: 0.875rem;
    font-weight: 500;
}

.server-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-element);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    padding: 1rem 1.25rem;
    background-color: var(--bg-element);
    gap: 0.5rem;
}

.card-action {
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 600;
    padding: 0 0.75rem;
}

.card-action.terminal, .card-action.restart, .card-action.power {
    padding: 0;
    width: 36px;
}

.card-action:hover {
    background-color: var(--bg-element-hover);
    color: var(--text-light);
}

.card-action.primary {
    background: var(--brand-gradient);
    color: white;
    border: none;
    margin-left: auto;
}

.card-action.primary:hover {
    box-shadow: var(--shadow-glow);
}

.card-action.success {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.card-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-action.disabled:hover {
    background-color: var(--bg-card);
    color: var(--text-muted);
}

.section-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Activity Section */
.activity-section {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    padding: 1rem;
    background-color: var(--bg-element);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background-color: var(--bg-element-hover);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.activity-icon.create {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.activity-icon.restart {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.activity-icon.stop {
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--neutral);
}

.activity-icon.login {
    background-color: rgba(55, 189, 248, 0.2);
    color: var(--provider-contabo);
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.activity-title {
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-description {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-running {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.status-stopped {
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--neutral);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.theme-toggle-label {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin-left: 0.5rem;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-element);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--brand-secondary);
    transition: .4s;
    border-radius: 50%;
}

.theme-toggle input:checked + .theme-toggle-slider {
    background-color: var(--bg-element);
}

.theme-toggle input:checked + .theme-toggle-slider:before {
    transform: translateX(24px);
    background-color: var(--brand-primary);
}

.theme-toggle-icon {
    color: var(--text-light);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Mobile Responsive Adjustments */
@media (max-width: 1200px) {
    .resource-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .server-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
        height: 100vh;
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 900;
        background-color: var(--bg-card);
        border-radius: var(--radius-md);
        padding: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .activity-feed {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .welcome-panel {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .welcome-graphic {
        position: relative;
        width: 100%;
        height: 100px;
        margin-top: 1rem;
    }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .resource-stats,
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-container input {
        width: 100%;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .server-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .server-badges {
        margin-top: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .header-actions .btn {
        padding: 0.375rem 0.625rem;
    }
    
    .top-bar {
        padding: 0.75rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 13, 26, 0.7);
    display: none;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 10px 25px var(--shadow-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
    z-index: 10;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-light);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background-color: var(--bg-card);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    z-index: 10;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-modal:hover {
    background-color: var(--bg-element);
    color: var(--text-light);
}

/* Form Styling for Modal */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-element);
    color: var(--text-light);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.25);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

.provider-select,
.location-select {
    position: relative;
}

.provider-select .provider-icon,
.location-select .location-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Remove arrow for select with custom icons */
.provider-select select,
.location-select select {
    background-image: none;
}

.provider-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.provider-icon.hetzner {
    background-color: var(--provider-hetzner);
}

.provider-icon.contabo {
    background-color: var(--provider-contabo);
}

.provider-icon.proxmox {
    background-color: var(--provider-proxmox);
}

.location-icon {
    color: var(--brand-primary);
}

/* Pricing Plans */
.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pricing-plan {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pricing-plan:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px var(--shadow-color);
}

.pricing-plan.selected {
    border-color: var(--brand-primary);
    background-color: rgba(138, 43, 226, 0.1);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.plan-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-light);
}

.plan-price {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-light);
}

.plan-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.plan-details div {
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
}

.plan-details i {
    margin-right: 0.5rem;
    width: 14px;
}

.pricing-plan input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.pricing-plan input[type="radio"]:checked ~ * {
    color: var(--brand-primary);
}

/* OS Options */
.os-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.os-option {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.os-option:hover {
    border-color: var(--brand-primary);
    background-color: rgba(138, 43, 226, 0.1);
}

.os-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.os-option input[type="radio"]:checked + .os-icon {
    color: var(--brand-primary);
}

.os-option input[type="radio"]:checked ~ .os-info .os-name {
    color: var(--brand-primary);
}

.os-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.os-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.os-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Pricing Summary */
.pricing-summary {
    background-color: var(--bg-element);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.summary-total {
    font-weight: 600;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

/* Light theme overrides */
body.light-theme .modal-container,
body.light-theme .modal-header,
body.light-theme .modal-footer {
    background-color: var(--bg-card);
}

body.light-theme .modal-header h3 {
    color: var(--text-light);
}

body.light-theme .close-modal:hover {
    background-color: var(--bg-element);
}

body.light-theme .pricing-summary {
    background-color: var(--bg-element);
}

body.light-theme .summary-total {
    color: var(--text-light);
}

body.light-theme .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .os-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-plans {
        grid-template-columns: repeat(2, 1fr);
    }
}
