:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Profile Header */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
    background-color: var(--bg-secondary);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.profile-img-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.shimmer-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 100%; 
    animation-duration: 1s;
    animation-fill-mode: forwards; 
    animation-iteration-count: infinite;
    animation-name: placeholderShimmer;
    animation-timing-function: linear;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

@keyframes placeholderShimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.profile-img:hover {
    transform: scale(1.05);
}

.welcome-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-badge {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
    font-family: monospace;
    font-size: 11px;
}

.premium-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

.premium-badge.not-premium {
    background: linear-gradient(135deg, #9ca3af, #4b5563);
    box-shadow: 0 1px 2px rgba(75, 85, 99, 0.2);
}

#username-display {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
    display: inline-flex;
    align-items: center;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header p {
    color: var(--text-secondary);
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Sections */
.section {
    background: var(--bg-primary);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.section:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.setting-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--bg-secondary);
}

.setting-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.setting-label label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Toggles */
.toggle-wrapper {
    display: flex;
    align-items: center;
}

.toggle-switch {
    appearance: none;
    width: 52px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch:checked {
    background: var(--primary);
}

.toggle-switch:checked::before {
    left: 22px;
}

/* Lists */
.list-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.list-item input {
    flex: 1;
    min-width: 0;
}

.list-item span {
    color: var(--text-secondary);
    font-weight: bold;
    flex-shrink: 0;
}

.list-item button {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-item button:hover {
    background: var(--danger);
    color: white;
}

.add-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--primary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-top: 16px;
    transition: all 0.2s ease;
}

.add-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    position: sticky;
    bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 100;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Loading & Status */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.status-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

@media (max-width: 640px) {
    .container { padding: 16px; }
    .action-buttons { flex-direction: column; }
    .nav-tabs { gap: 5px; }
    .tab-btn { padding: 8px 16px; font-size: 13px; }
}

/* Commands Page Layout */
body.commands-page {
    background: #0f172a;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100%;
    max-width: 1800px;
    margin: 0 auto;
    background: radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.15), transparent 40%),
                radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.15), transparent 40%);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-icon {
    color: #60a5fa;
    font-size: 24px;
}

.nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.nav-scroll::-webkit-scrollbar {
    width: 4px;
}

.nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 12px;
    padding-left: 12px;
    font-weight: 700;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
}

.nav-item i {
    font-size: 18px;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.mobile-header {
    display: none;
    align-items: center;
    grid-template-columns: 40px 1fr 40px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 40;
}

.mobile-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    grid-column: 2;
}

.mobile-header a {
    grid-column: 3;
    justify-self: end;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* Search */
.search-container {
    padding: 24px 40px;
    background: transparent;
    z-index: 30;
}

.search-box {
    position: relative;
    max-width: 600px;
}

.search-container .search-input {
    width: 100%;
    background: #1e293b; /* Solid dark slate color */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px 16px 55px; /* More padding for icon */
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-container .search-input::placeholder {
    color: #94a3b8;
}

.search-container .search-input:focus {
    background: #0f172a; /* Even darker on focus */
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #60a5fa;
    font-size: 20px;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-box:focus-within .search-icon {
    color: #3b82f6;
    transform: translateY(-50%) scale(1.1);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Content Scroll */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px 40px;
    scroll-behavior: smooth;
}

.content-scroll::-webkit-scrollbar {
    width: 8px;
}

.content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Sections */
.command-section {
    margin-bottom: 40px;
    scroll-margin-top: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title i {
    color: #60a5fa;
}

/* Grid & Cards */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.command-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.command-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateY(-2px);
}

.command-card.warning {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Bottom Sheet Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--bg-primary);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUpModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

@keyframes slideUpModal {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.summary-item:hover {
    background: var(--bg-primary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.summary-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-passive {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Top Navigation Buttons */
.top-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.nav-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.nav-icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.cmd-header {
    margin-bottom: 8px;
}

.cmd-code {
    font-family: 'JetBrains Mono', monospace;
    color: #60a5fa;
    font-weight: 700;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
}

.cmd-desc {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.command-card.expanded .cmd-desc {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.cmd-desc ul {
    padding-left: 20px;
    margin: 0;
}

.cmd-sub {
    font-size: 12px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.cmd-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #f59e0b;
    font-size: 12px;
    text-decoration: none;
    margin-top: 8px;
}

.cmd-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-header {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
    }

    .search-container {
        padding: 16px 20px;
    }

    .content-scroll {
        padding: 0 20px 20px 20px;
    }

    .commands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
