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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --border-color: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent: #ffffff;
    --accent-hover: #cccccc;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.brand-icon {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.5px;
    padding: 4px 6px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 4px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255,255,255,0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(255,255,255,0.6)); }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.admin-link {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-link:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.logout-link {
    color: var(--error);
}

.main-content {
    padding-top: 88px;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;
    position: relative;
    z-index: 1;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    animation: slide-down 0.4s ease-out;
    font-size: 14px;
}

@keyframes slide-down {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

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

.alert-text {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-container {
    min-height: calc(100vh - 88px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: fade-up 0.6s ease-out;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 16px;
    display: inline-flex;
    padding: 8px 16px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 8px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--text-primary);
}

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

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    opacity: 0.7;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

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

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

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    animation: fade-up 0.5s ease-out;
}

.header-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.header-content p {
    color: var(--text-secondary);
    font-size: 15px;
}

.header-stats {
    display: flex;
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.dropzone-icon {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 16px;
    opacity: 0.3;
    padding: 12px 24px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    display: inline-block;
}

.dropzone h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dropzone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.dropzone-info {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 12px !important;
}

.dropzone-preview {
    text-align: left;
}

.file-info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.file-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-meta {
    display: flex;
    gap: 20px;
}

.file-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-meta-item strong {
    color: var(--text-primary);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    width: 100%;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.upload-container {
    max-width: 640px;
    margin: 0 auto;
}

.dropzone-lg {
    padding: 60px 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.feature-item:hover {
    background: var(--bg-card-hover);
}

.feature-name {
    font-size: 13px;
    font-weight: 600;
}

.feature-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: var(--transition);
}

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

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--bg-primary);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-uploaded {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-building {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

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

.status-pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.role-user {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.page-header {
    margin-bottom: 32px;
    animation: fade-up 0.5s ease-out;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.features-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.features-form .features-grid {
    margin-bottom: 8px;
}

.recent-builds .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.type-dropdown {
    margin-bottom: 24px;
    animation: fade-up 0.5s ease-out;
}

.type-combo {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    min-width: 200px;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.type-combo:hover {
    border-color: rgba(255,255,255,0.2);
}

.type-combo:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--text-primary);
}

.type-combo option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.type-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.build-area {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pending-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.pending-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    width: 100%;
    justify-content: center;
}

.pending-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.pending-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.pending-type {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.latest-builds {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.latest-builds h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.build-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.build-row:last-child {
    border-bottom: none;
}

.build-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.small.empty-state {
    padding: 20px !important;
    font-size: 13px;
}

.build-mega-area {
    margin-bottom: 24px;
    animation: fade-up 0.5s ease-out;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
}

.build-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-pick-zone {
    flex: 1;
    cursor: pointer;
}

.file-pick-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.file-pick-zone:hover .file-pick-content {
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

.fp-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.fp-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-build {
    padding: 20px 48px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.btn-build:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.btn-build:active {
    transform: scale(0.98);
}

.btn-build .btn-loader {
    display: none;
}

.btn-build.btn-loading .btn-build-text {
    visibility: hidden;
}

.btn-build.btn-loading .btn-loader {
    display: inline-block;
    position: absolute;
}

.pulse-anim {
    position: relative;
}

.pulse-anim::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--text-primary);
    animation: pulse-ring 1.5s ease-out infinite;
    opacity: 0;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 0; }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

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

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
