/* ============================================
   Cloud PC Management - Modern UI Styles
   Enterprise-grade SaaS Dashboard Design
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* CSS Variables - Design System */
:root {
    /* Primary Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;

    /* Secondary Colors */
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;

    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --border-color: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar - Modern Enterprise Style */
.navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    transition: all var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand img {
    height: 36px;
    width: auto;
    border-radius: var(--radius-md);
}

.navbar-brand .brand-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.08);
}

/* Market Activity Banner */
.search-banner-content-pc___uUlnv {
    width: 100%;
    background: linear-gradient(135deg, #f4f8ff 0%, #e1edff 100%);
    padding: 48px 56px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    border: none;
}

/* Crystal-like background graphics */
.search-banner-content-pc___uUlnv::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: 
        radial-gradient(circle at 60% 40%, rgba(44, 120, 249, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(0, 213, 163, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.search-banner-title___T6piy {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(90deg, #1055ff 0%, #00d29b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

.search-banner-desc___CoGNa {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
    max-width: 65%;
    margin: 0;
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .search-banner-content-pc___uUlnv {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .search-banner-title___T6piy {
    background: linear-gradient(90deg, #3b82f6 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .search-banner-desc___CoGNa {
    color: #94a3b8;
}

.nav-link.active {
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.12);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Buttons - Modern Style */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* Cards - Modern Glass Effect */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Form Controls - Modern Style */
.form-control,
.form-select {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
    outline: none;
    color: var(--text-primary);
}

.form-control:invalid,
.form-select:invalid,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--border-color);
    box-shadow: none;
}

.form-control:focus:invalid,
.form-select:focus:invalid,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* Tabs - Modern Style */
.nav-tabs {
    border-bottom: 2px solid var(--border-light);
    gap: 8px;
    padding-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: relative;
    font-weight: 500;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    border: none;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: var(--bg-secondary);
    border: none;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    background: var(--primary);
}

.tab-content {
    padding-top: 1.5rem;
}

/* Alerts - Modern Style */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert::before {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-info::before {
    content: 'i';
    background: var(--info);
    color: white;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-success::before {
    content: '✓';
    background: var(--success);
    color: white;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-warning::before {
    content: '!';
    background: var(--warning);
    color: white;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-danger::before {
    content: '!';
    background: var(--danger);
    color: white;
}

/* Tables - Modern Style */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.table > thead {
    background: var(--bg-tertiary);
}

.table > thead th {
    font-weight: 700;
    color: var(--text-secondary);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table > tbody > tr {
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.table > tbody > tr:hover {
    background: rgba(79, 70, 229, 0.04);
}

[data-theme="dark"] .table > tbody > tr:hover {
    background: rgba(79, 70, 229, 0.08);
}

.table > tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges - Modern Style */
.badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
}

.badge bg-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%) !important;
}

.badge bg-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%) !important;
    color: var(--text-inverse) !important;
}

.badge bg-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%) !important;
}

/* Status Badges - Custom */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.status-badge.inactive {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* Accordion - Modern Style */
.accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: var(--border-color);
}

.accordion-item {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.accordion-button::after {
    filter: var(--text-secondary);
}

.accordion-body {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    background: transparent;
}

/* Modal - Modern Style */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

.btn-close {
    filter: var(--text-secondary);
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-brand {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand img {
    height: 28px;
    border-radius: var(--radius-sm);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
}

.shadow-glow {
    box-shadow: var(--shadow-glow);
}

.border-subtle {
    border-color: var(--border-light) !important;
}

/* Cloud Card Hover Effect */
.cloud-card {
    transition: all var(--transition-base);
    cursor: pointer;
}

.cloud-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Info Box - Modern */
.info-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
}

.info-box code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--primary);
}

/* Stats Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--bg-secondary);
        padding: 1rem;
        border-radius: var(--radius-lg);
        margin-top: 0.5rem;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
    }

    .navbar-nav {
        gap: 4px;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .card-body {
        padding: 1rem;
    }

    .table > thead th,
    .table > tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-brand img {
        height: 28px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(79, 70, 229, 0.2);
    color: var(--text-primary);
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .theme-toggle {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
