/* MLBB Mod Key Manager - Dark Theme Styles */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: #000000;
    color: #E4E4E7;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Color Variables */
:root {
    --brand-blue: #3B82F6;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
    --purple-accent: #8B5CF6;
    
    --bg-page: #000000;
    --bg-surface-1: #0A0A0A;
    --bg-surface-2: #141414;
    --bg-surface-3: #1E1E1E;
    --bg-border: #2A2A2A;
    
    --text-primary: #E4E4E7;
    --text-secondary: #A1A1AA;
    --text-accent: #FFFFFF;
    --text-placeholder: #71717A;
    
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-xxl: 64px;
    --spacing-xxxl: 96px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-card: 0 8px 32px rgba(59, 130, 246, 0.12);
    --shadow-button: 0 4px 16px rgba(59, 130, 246, 0.16);
    --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.32);
}

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

/* Header */
.header {
    background-color: var(--bg-surface-2);
    border-bottom: 1px solid var(--bg-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-section i {
    font-size: 24px;
    color: var(--brand-blue);
}

.logo-section h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-accent);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    width: 100%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background-color: var(--bg-surface-1);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.2s ease;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.active {
    background-color: var(--success-green);
    color: white;
}

.stat-icon.expired {
    background-color: var(--error-red);
    color: white;
}

.stat-icon.total {
    background-color: var(--brand-blue);
    color: white;
}

.stat-icon.today {
    background-color: var(--purple-accent);
    color: white;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

/* Controls Section */
.controls-section {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
}

.search-box input {
    width: 100%;
    height: 48px;
    background-color: var(--bg-surface-3);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0 16px 0 48px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-input);
}

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

.filter-tabs {
    display: flex;
    gap: 8px;
    background-color: var(--bg-surface-3);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab.active {
    background-color: var(--brand-blue);
    color: white;
}

.filter-tab:hover:not(.active) {
    color: var(--text-primary);
}

/* Table Container */
.table-container {
    background-color: var(--bg-surface-1);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-accent);
}

.table-actions {
    display: flex;
    gap: var(--spacing-sm);
}

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

.keys-table {
    width: 100%;
    border-collapse: collapse;
}

.keys-table th {
    background-color: var(--bg-surface-2);
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--bg-border);
}

.keys-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--bg-border);
    font-size: 14px;
}

.keys-table tbody tr {
    background-color: var(--bg-surface-1);
    transition: all 0.2s ease;
}

.keys-table tbody tr:hover {
    background-color: var(--bg-surface-2);
    transform: translateY(-1px);
}

.key-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--brand-blue);
}

.user-email {
    color: var(--text-primary);
}

.status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

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

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-icon.view {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--brand-blue);
}

.btn-icon.view:hover {
    background-color: var(--brand-blue);
    color: white;
}

.btn-icon.edit {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-orange);
}

.btn-icon.edit:hover {
    background-color: var(--warning-orange);
    color: white;
}

.btn-icon.delete {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error-red);
}

.btn-icon.delete:hover {
    background-color: var(--error-red);
    color: white;
}

/* Pagination */
.pagination {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Buttons */
.btn {
    height: 48px;
    padding: 0 var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #2563EB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

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

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

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

.btn-warning:hover:not(:disabled) {
    background-color: #D97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

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

.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-surface-2);
    border-color: var(--text-secondary);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-surface-1);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-accent);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--bg-border);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 48px;
    background-color: var(--bg-surface-3);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0 var(--spacing-sm);
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-input);
}

.form-group textarea {
    height: auto;
    resize: vertical;
    padding: var(--spacing-sm);
}

.form-help {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Validation Result */
.validation-result {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

.validation-result.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-green);
    color: var(--success-green);
}

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

/* Permission Options */
.permission-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-blue);
}

/* Generated Key */
.generated-key {
    background-color: var(--bg-surface-3);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.key-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.key-display code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--brand-blue);
    background: transparent;
    padding: 0;
    word-break: break-all;
}

/* Key Details */
.key-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.detail-card {
    background-color: var(--bg-surface-3);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
}

.detail-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.detail-card .status-badge {
    margin-top: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: var(--text-primary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-surface-3);
    border-top: 4px solid var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--bg-surface-1);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    min-width: 300px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--error-red);
}

.toast.warning {
    border-left: 4px solid var(--warning-orange);
}

.toast.info {
    border-left: 4px solid var(--brand-blue);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 var(--spacing-sm);
    }
    
    .main-content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .controls-section {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-tabs {
        overflow-x: auto;
        padding: 4px 2px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-md);
    }
    
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .table-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
    
    .table-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: var(--spacing-sm);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .keys-table th,
    .keys-table td {
        padding: 12px 16px;
    }
    
    .btn {
        height: 44px;
        padding: 0 var(--spacing-sm);
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .header,
    .controls-section,
    .modal,
    .loading-overlay,
    .toast-container {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .table-container {
        border: 1px solid #000;
    }
    
    .keys-table th,
    .keys-table td {
        border: 1px solid #000;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg-border: #FFFFFF;
        --text-secondary: #FFFFFF;
    }
}