/* Tab scroll arrows */
.tab-scroll {
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 0.5rem;
    cursor: pointer;
}

.tab-scroll:hover { color: #374151; }

body.dark-mode .tab-scroll { color: #9ca3af; }
body.dark-mode .tab-scroll:hover { color: #e5e7eb; }
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* App Layout */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    transition: all 0.3s ease;
    user-select: none;
}

.logo:hover {
    color: #3730a3;
    transform: translateY(-1px);
    text-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-container input {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    width: 300px;
    outline: none;
}

.search-container input:focus {
    box-shadow: inset 0 0 0 2px #4f46e5;
}

.btn-search {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #4338ca;
}

/* User Menu */
.user-menu {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.btn-user:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: #4f46e5;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.tab-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    flex: 1 1 auto;
}

.tab-strip::-webkit-scrollbar { height: 6px; }
.tab-strip::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
body.dark-mode .tab-strip::-webkit-scrollbar-thumb { background: #4b5563; }

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #4f46e5;
}

.content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Logs Container */
.logs-container {
    padding: 2rem;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.logs-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.logs-stats {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Logs List */
.logs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.log-entry {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    position: relative;
}

.log-entry.highlight {
    outline: 2px solid #00d4ff;
    transition: outline 0.2s ease;
}

.log-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #4f46e5;
}

.log-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.log-text {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}

.log-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.log-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #6b7280;
}

.log-meta-item i {
    font-size: 0.7rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

/* Danger button */
.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Tables */
.users-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.users-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.users-table tr:hover {
    background: #f8fafc;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Loading */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.loading-indicator i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: #10b981;
}

.toast.error i {
    color: #ef4444;
}

.toast.warning i {
    color: #f59e0b;
}

/* Links */
a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #4338ca;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .search-container input {
        width: 200px;
    }

    .main-content {
        padding: 1rem;
    }

    .log-content {
        flex-direction: column;
        align-items: stretch;
    }

    .log-actions {
        justify-content: flex-end;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .search-container input {
        width: 150px;
    }

    .log-entry {
        padding: 1rem;
    }

    .log-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Dark Mode Toggle Button */
.btn-dark-mode {
    background: #374151;
    color: #00d4ff;
    border: 1px solid #4b5563;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-dark-mode:hover {
    background: #4b5563;
    color: #00b8e6;
    transform: translateY(-1px);
}

.btn-dark-mode i {
    font-size: 1rem;
}

/* Dark Mode Theme */
body.dark-mode {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #e5e7eb;
}

body.dark-mode .header {
    background: rgba(31, 41, 55, 0.95);
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

body.dark-mode .logo {
    color: #00d4ff;
}

body.dark-mode .logo:hover {
    color: #00b8e6;
    text-shadow: 0 2px 4px rgba(0, 212, 255, 0.3);
}

body.dark-mode .search-container {
    background: transparent;
}

body.dark-mode .search-container input {
    background: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

body.dark-mode .search-container input::placeholder {
    color: #9ca3af;
}

body.dark-mode .btn-search {
    background: #00d4ff;
    color: #1f2937;
    border: none;
}

body.dark-mode .btn-search:hover {
    background: #00b8e6;
    color: #1f2937;
}

body.dark-mode .btn-user {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

body.dark-mode .btn-user:hover {
    background: #4b5563;
}

body.dark-mode .dropdown-menu {
    background: #374151;
    border: 1px solid #4b5563;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .dropdown-menu a {
    color: #e5e7eb;
}

body.dark-mode .dropdown-menu a:hover {
    background: #4b5563;
    color: #00d4ff;
}

body.dark-mode .tab-navigation {
    background: #374151;
    border-bottom: 2px solid #4b5563;
    border-radius: 8px;
    padding: 0.5rem;
}

body.dark-mode .tab-btn {
    color: #9ca3af;
}

body.dark-mode .tab-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .tab-btn.active {
    background: #00d4ff;
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0, 212, 255, 0.3);
}

body.dark-mode .tab-btn.active::after {
    border-bottom: 6px solid #00d4ff;
}

body.dark-mode .content-wrapper {
    background: rgba(31, 41, 55, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

body.dark-mode .log-entry {
    background: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

body.dark-mode .log-entry:hover {
    border-color: #00d4ff;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.1);
}

body.dark-mode .log-text {
    color: #e5e7eb;
}

body.dark-mode .log-meta {
    border-top: 1px solid #4b5563;
}

body.dark-mode .log-meta-item {
    background: #4b5563;
    color: #9ca3af;
}

body.dark-mode .log-meta-item a {
    color: #8be9fd !important;
    font-weight: 600;
}

body.dark-mode .logs-header h3 {
    color: #e5e7eb;
}

body.dark-mode .logs-container {
    background: #1f2937;
    border-radius: 8px;
}

body.dark-mode .logs-header {
    background: #374151 !important;
    border-bottom: 2px solid #4b5563 !important;
    border-radius: 8px;
}

body.dark-mode .logs-stats {
    color: #9ca3af;
}

body.dark-mode .modal-content {
    background: #374151;
    color: #e5e7eb;
}

body.dark-mode .modal-header {
    border-bottom: 1px solid #4b5563;
}

body.dark-mode .modal-header h2 {
    color: #e5e7eb;
}

body.dark-mode .modal-close {
    color: #9ca3af;
}

body.dark-mode .modal-close:hover {
    background: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .form-group label {
    color: #e5e7eb;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background: #4b5563;
    border: 1px solid #6b7280;
    color: #e5e7eb;
}

body.dark-mode .form-group input::placeholder {
    color: #9ca3af;
}

body.dark-mode .btn-primary {
    background: #00d4ff;
    color: #1f2937;
}

body.dark-mode .btn-primary:hover {
    background: #00b8e6;
}

body.dark-mode .btn-secondary {
    background: #6b7280;
    color: #e5e7eb;
}

body.dark-mode .btn-secondary:hover {
    background: #4b5563;
}

body.dark-mode .users-table {
    background: #374151;
    color: #e5e7eb;
}

body.dark-mode .users-table th {
    background: #4b5563;
    color: #e5e7eb;
    border-bottom: 1px solid #6b7280;
}

body.dark-mode .users-table td {
    border-bottom: 1px solid #4b5563;
}

body.dark-mode .users-table tr:hover {
    background: #4b5563;
}

body.dark-mode .toast {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

body.dark-mode .toast.success {
    border-left: 4px solid #10b981;
}

body.dark-mode .toast.error {
    border-left: 4px solid #ef4444;
}

body.dark-mode .toast.info {
    border-left: 4px solid #00d4ff;
}