/* ========================================
   B4S1-BU1LD M4TR1X T3RM1N4L STYL3S
   ======================================== */

:root {
    --primary: #00ff00;
    --primary-dark: #00cc00;
    --primary-light: #33ff33;
    --danger: #ff0000;
    --warning: #ffff00;
    --success: #00ff00;
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-light: #111111;
    --surface-lighter: #1a1a1a;
    --text: #00ff00;
    --text-dim: #00cc00;
    --text-dimmer: #009900;
    --border: #00ff00;
    --border-light: #00cc00;
    --shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    --matrix-glow: 0 0 10px #00ff00;
}

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

body {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    text-shadow: 0 0 5px var(--primary);
    font-size: 16px;
}

/* Matrix effect animations */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 999;
    animation: flicker 0.15s infinite;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 26, 0.95);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    font-size: 1.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--text-dim);
    font-weight: 500;
}

.role-badge {
    background: var(--primary);
    color: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    font-weight: 600;
    text-transform: uppercase;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    flex: 1;
    width: 100%;
}

.section {
    animation: fadeIn 0.3s ease;
}

/* Authentication */
.auth-container {
    max-width: 400px;
    margin: 5rem auto;
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px var(--shadow);
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select, textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-size: 1.1rem;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--matrix-glow);
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: 2px solid var(--primary);
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: var(--matrix-glow);
    background: var(--surface);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg) !important;
    border-color: var(--primary);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--bg);
    box-shadow: 0 0 30px var(--primary);
    animation: flicker 0.1s infinite;
}

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

.btn-secondary:hover {
    background: var(--surface-lighter);
    border-color: var(--border-light);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    display: none;
    animation: slideDown 0.3s ease;
}

.alert.show {
    display: block;
}

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

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

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

/* Tabs */
.tabs {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 1rem 0;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--text);
}

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

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.875rem;
    margin-bottom: 1.875rem;
    box-shadow: var(--matrix-glow);
}

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

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 1.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Upload Section */
.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 968px) {
    .upload-section {
        grid-template-columns: 1fr;
    }
}

.file-input-wrapper {
    position: relative;
}

.file-info {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.upload-progress {
    margin: 1.25rem 0;
}

.progress-bar {
    height: 0.5rem;
    background: var(--surface-light);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    width: 0;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-dim);
    text-align: center;
}

/* Advanced Options */
.advanced-options {
    margin-top: 1.875rem;
    padding-top: 1.875rem;
    border-top: 1px solid var(--border);
}

.option-group {
    margin-bottom: 1.25rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.option-label input[type="checkbox"] {
    width: auto;
}

.option-content {
    margin-left: 1.875rem;
    margin-top: 0.625rem;
}

.help-text {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Uploads List */
.uploads-list {
    margin-top: 1.25rem;
}

.upload-item {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.upload-item:hover {
    border-color: var(--border-light);
    transform: translateX(2px);
}

.upload-info {
    flex: 1;
}

.upload-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
    color: var(--text);
}

.upload-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.upload-url {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--primary);
    word-break: break-all;
    margin-top: 0.625rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 0.25rem;
    border: 1px solid var(--border);
}

.upload-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 1rem;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

/* Users Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: var(--surface-light);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.users-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.users-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-expires {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 1.875rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text);
}

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

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--text-dim);
}

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.625rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

/* Password Strength */
.password-strength {
    height: 0.25rem;
    background: var(--surface-light);
    border-radius: 0.125rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength.weak::after {
    width: 33%;
    background: var(--danger);
}

.password-strength.medium::after {
    width: 66%;
    background: var(--warning);
}

.password-strength.strong::after {
    width: 100%;
    background: var(--success);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80%, 100% {
        content: '';
    }
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1.25rem 0.625rem;
    }
    
    .auth-container {
        margin: 2rem auto;
        padding: 1.875rem 1.25rem;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        gap: 0.625rem;
        overflow-x: auto;
    }
    
    .tab {
        white-space: nowrap;
        padding: 1rem 0.625rem;
    }
}

/* Input with Prefix */
.input-with-prefix {
    display: flex;
    align-items: center;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
}

.input-with-prefix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.input-prefix {
    padding: 0.75rem 1rem;
    background: var(--surface-lighter);
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    font-size: 0.95rem;
    white-space: nowrap;
}

.input-with-prefix input {
    border: none;
    background: transparent;
    flex: 1;
}

.input-with-prefix input:focus {
    outline: none;
    box-shadow: none;
}

/* Log Viewer Styles */
.modal-large {
    max-width: 1200px;
    width: 90%;
}

.log-viewer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.log-file-info h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.25rem;
}

.log-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.log-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.log-search {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    width: 250px;
}

.log-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.log-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.log-stat {
    background: var(--surface-light);
    padding: 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--border);
}

.log-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.log-stat .stat-label {
    font-size: 0.875rem;
    color: var(--text-dim);
}

.log-entries {
    max-height: 500px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.log-entry {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.log-entry:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-entry.log-bot {
    border-left: 4px solid var(--warning);
}

.log-timestamp {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.log-label {
    font-weight: 600;
    color: var(--text-dim);
    min-width: 80px;
    font-size: 0.875rem;
}

.log-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    color: var(--text);
    word-break: break-all;
}

.log-time {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--surface-lighter);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.bot-badge {
    background: var(--warning);
    color: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.browser-badge {
    background: var(--surface-lighter);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Scrollbar styling for log entries */
.log-entries::-webkit-scrollbar {
    width: 8px;
}

.log-entries::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.log-entries::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.log-entries::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Upload Mode Toggle */
.upload-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--surface-light);
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.mode-btn:hover {
    color: var(--text);
    background: var(--surface-lighter);
}

.mode-btn.active {
    background: var(--primary);
    color: var(--bg) !important;
    box-shadow: 0 0 20px var(--primary);
    font-weight: 700;
}

/* Code Paste Styles */
#codeContent {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    tab-size: 4;
    background: var(--surface);
    min-height: 400px;
    resize: vertical;
    white-space: pre;
}

#codeStats {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.upload-mode-content {
    animation: fadeIn 0.3s ease;
}

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

/* Code Viewer Styles */
.code-viewer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.code-file-info h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.code-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--text-dim);
}

.code-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.code-display {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0;
    padding: 1.5rem;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
}

.code-line {
    display: flex;
    line-height: 1.6;
    font-size: 1rem;
}

.code-line:hover {
    background: var(--surface-light);
}

.line-number {
    color: var(--text-dimmer);
    padding-right: 1.5rem;
    text-align: right;
    user-select: none;
    min-width: 60px;
    border-right: 1px solid var(--border);
    margin-right: 1rem;
}

.line-content {
    color: var(--text);
    white-space: pre;
    flex: 1;
}

/* Scrollbar for code display */
.code-display::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.code-display::-webkit-scrollbar-track {
    background: var(--surface);
    border: 1px solid var(--border);
}

.code-display::-webkit-scrollbar-thumb {
    background: var(--primary);
    border: 1px solid var(--bg);
}

.code-display::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary);
}