/* Notification Styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 400px;
    position: relative;
    transform: translateX(420px);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border-left-color: #4caf50;
}

.notification.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    border-left-color: #f44336;
}

.notification.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-left-color: #2196f3;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 2rem 40px;
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
}

.admin-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.admin-header p {
    font-size: 1.1rem;
    color: #9ca3af;
}

.admin-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-card {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #374151;
    height: fit-content;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-picture-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #818cf8;
    object-fit: cover;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.edit-picture-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #818cf8;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-picture-btn:hover {
    background: #6366f1;
    transform: scale(1.1);
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.subscription-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.subscription-badge.free {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.subscription-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #1f2937;
}

.subscription-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1f2937;
}

.subscription-badge.platinum {
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    color: #1f2937;
}

.profile-details {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.5);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #9ca3af;
}

.detail-value {
    color: #e5e7eb;
    font-weight: 500;
}

.detail-subtext {
    display: block;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.plan-option {
    background: rgba(55, 65, 81, 0.4);
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
    min-height: 180px;
}

.plan-option:hover {
    border-color: #4b5563;
    transform: translateY(-2px);
}

.plan-option .subscription-badge {
    align-self: flex-start;
}

.plan-option p {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.5;
}

.subscription-key-card {
    margin-top: 1.75rem;
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 1.5rem;
}

.subscription-key-card h5 {
    color: #e5e7eb;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subscription-key-card p {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.subscription-key-input-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.subscription-key-input-group input {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid #374151;
    background: #111827;
    color: #e5e7eb;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.subscription-key-input-group input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.subscription-key-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.subscription-key-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.subscription-key-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.variables-modal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.variables-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #9ca3af;
    font-size: 0.85rem;
}

.variables-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.variables-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variables-empty-state {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    background: rgba(55, 65, 81, 0.35);
    border: 1px dashed rgba(129, 140, 248, 0.25);
    border-radius: 10px;
}

.admin-tabs {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    border: 1px solid #374151;
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: rgba(55, 65, 81, 0.5);
}

.tab-nav button {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-nav button.active {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
    border-bottom-color: #818cf8;
}

.tab-nav button:hover:not(.active) {
    color: #e5e7eb;
    background: rgba(55, 65, 81, 0.8);
}

.tab-content {
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e5e7eb;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: #818cf8;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Picture URL Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border: 1px solid #374151;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #e5e7eb;
    background: rgba(55, 65, 81, 0.5);
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #374151;
    border-top: 2px solid #818cf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Application Card Styles */
.app-card {
    background: rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    transition: all 0.3s ease;
}

.app-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.1);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.app-image-container {
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}

.app-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .app-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-card-actions {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-start;
    }
}

.app-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(129, 140, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(129, 140, 248, 0.3);
    overflow: hidden;
    position: relative;
}

.app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.app-image i {
    color: #818cf8;
    font-size: 20px;
}

.edit-app-image-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #818cf8;
    border: 2px solid #1f2937;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.edit-app-image-btn:hover {
    background: #6366f1;
}

.app-card h5 {
    color: #e5e7eb;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.collaborator-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.app-card-collaborator {
    border-color: rgba(139, 92, 246, 0.3);
}

.app-card-collaborator:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #374151;
    border-radius: 3px;
    background: #111;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #10b981;
    border-color: #10b981;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Thread Management Modal Styles */
.thread-management-content {
    margin-top: 1rem;
}

.thread-tabs {
    display: flex;
    border-bottom: 2px solid #374151;
    margin-bottom: 1.5rem;
}

.thread-tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.thread-tab-btn:hover {
    color: #e5e7eb;
    background: rgba(55, 65, 81, 0.3);
}

.thread-tab-btn.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.thread-tab-content {
    display: none;
}

.thread-tab-content.active {
    display: block;
}

.thread-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.threads-management-list {
    max-height: 400px;
    overflow-y: auto;
}

.thread-management-item {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.thread-management-info {
    flex: 1;
    margin-right: 16px;
}

.thread-management-title {
    color: #e5e7eb;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-management-meta {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.thread-management-preview {
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.4;
}

.thread-management-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.thread-status-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.status-locked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-unlocked {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pinned {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Banner Management Styles */
.banner-management-content {
    padding: 1rem 0;
}

.banner-section {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.banner-section h5 {
    color: #e5e7eb;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #374151;
}

/* Role Management Styles */
.role-management {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem;
}

.users-with-roles-list {
    background: #0f1419;
    border: 1px solid #374151;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.role-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #374151;
    transition: background-color 0.2s;
}

.role-user-item:last-child {
    border-bottom: none;
}

.role-user-item:hover {
    background: #1f2937;
}

.role-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
}

.role-user-name {
    color: #e5e7eb;
    font-weight: 500;
}

.role-user-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-user-badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.role-user-badge.moderator {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-user-actions .btn-remove {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-user-actions .btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.no-users-message {
    color: #9ca3af;
    text-align: center;
    padding: 30px;
}

.no-users-message i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.user-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #374151;
    border-radius: 6px;
    margin-top: 0.5rem;
    background: #0f1419;
}

.user-search-item {
    padding: 12px;
    border-bottom: 1px solid #374151;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.user-search-item:last-child {
    border-bottom: none;
}

.user-search-item:hover {
    background: #1f2937;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
}

.current-user-roles {
    min-height: 150px;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 1rem;
    background: #0f1419;
}

.role-assignment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #1f2937;
    border-radius: 6px;
    margin-bottom: 8px;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #dc2626;
    color: white;
}

.role-moderator {
    background: #059669;
    color: white;
}

.role-member {
    background: #2563eb;
    color: white;
}

.role-guest {
    background: #6b7280;
    color: white;
}

/* Forum Settings Modal Styles */
.forum-tabs {
    display: flex;
    border-bottom: 1px solid #374151;
    margin-bottom: 2rem;
    gap: 4px;
}

.forum-tab-btn {
    background: #374151;
    border: none;
    color: #9ca3af;
    padding: 12px 20px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.forum-tab-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.forum-tab-btn.active {
    background: #1f2937;
    color: #4facfe;
    border-bottom: 2px solid #4facfe;
}

.forum-tab-content {
    display: none;
}

.forum-tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

.banner-preview {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.preview-banner {
    position: relative;
    background: #0f1419;
    border-radius: 6px;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px;
}

.preview-text h5 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.preview-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.role-info-section {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.standard-roles-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.role-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #0f1419;
    border: 1px solid #374151;
    border-radius: 6px;
}

.role-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
    justify-content: center;
}

.role-badge.admin {
    background: linear-gradient(135deg, #dc2626, #f87171);
    color: white;
}

.role-badge.moderator {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: white;
}

.role-badge.member {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.role-description {
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.5;
}

.user-assignment-section {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem;
}

.available-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.role-option {
    background: #0f1419;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.role-option:hover {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.role-option.selected {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.2);
}

.current-roles-section {
    margin-top: 1.5rem;
}

.available-roles-section {
    margin-top: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Advanced Color Picker Styles */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #374151;
    cursor: pointer;
    background: #2563eb;
    transition: all 0.2s;
}

.color-preview:hover {
    border-color: #4facfe;
}

.color-picker-btn {
    background: #374151;
    border: 1px solid #4b5563;
    color: #9ca3af;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-picker-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.color-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    z-index: 1000;
    margin-top: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.color-picker-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #374151;
}

.color-tab-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.color-tab-btn:hover {
    background: #374151;
    color: #e5e7eb;
}

.color-tab-btn.active {
    background: #0f1419;
    color: #4facfe;
    border-bottom: 2px solid #4facfe;
}

.color-tab-content {
    display: none;
}

.color-tab-content.active {
    display: block;
}

.preset-colors, .gradient-colors {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    border-color: #4facfe;
    transform: scale(1.1);
}

.color-option.gradient {
    position: relative;
}

.rgb-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rgb-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rgb-control label {
    width: 40px;
    font-size: 12px;
    color: #e5e7eb;
}

.rgb-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #374151;
    outline: none;
}

.rgb-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
}

.rgb-control span {
    width: 30px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.rgb-preview {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #374151;
    background: #2563eb;
    margin: 8px 0;
}

.banner-section .form-group {
    margin-bottom: 1rem;
}

.banner-section .form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.banner-section label {
    display: block;
    color: #e5e7eb;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.banner-section input {
    width: 100%;
    padding: 0.75rem;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.banner-section input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

.app-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-info-item {
    display: flex;
    flex-direction: column;
}

.app-info-label {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.app-info-value {
    color: #e5e7eb;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.api-key-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-masked {
    background: rgba(55, 65, 81, 0.5);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #9ca3af;
    cursor: pointer;
    flex: 1;
}

.api-key-revealed {
    background: rgba(55, 65, 81, 0.8);
    color: #e5e7eb;
}

.copy-btn {
    background: #374151;
    border: 1px solid #4b5563;
    color: #9ca3af;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }

    .admin-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-card {
        order: -1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-header h1 {
        font-size: 2rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-nav button {
        flex: 1;
        min-width: 120px;
    }
}

/* ============================================
   ENHANCED ADMIN PANEL STYLES
   Modern, polished UI with animations
   ============================================ */

/* === CSS VARIABLES === */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --card-bg: linear-gradient(135deg, rgba(23, 25, 35, 0.95) 0%, rgba(15, 17, 25, 0.98) 100%);
    --glow-primary: rgba(99, 102, 241, 0.15);
    --glow-secondary: rgba(139, 92, 246, 0.12);
    --border-subtle: rgba(99, 102, 241, 0.12);
    --border-hover: rgba(99, 102, 241, 0.35);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* === KEYFRAMES === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-25px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(25px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--glow-primary); }
    50% { box-shadow: 0 0 35px var(--glow-primary), 0 0 50px var(--glow-secondary); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === BODY BACKGROUND === */
body {
    background: linear-gradient(135deg, #0a0a0f 0%, #0d0d18 50%, #0a0a12 100%) !important;
    min-height: 100vh;
}

/* === ENHANCED NAVBAR === */
.navbar {
    background: rgba(10, 12, 20, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .logo {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.navbar .logo i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === ADMIN CONTAINER === */
.admin-container {
    animation: fadeInUp 0.6s ease-out;
}

/* === ADMIN HEADER === */
.admin-header {
    margin-bottom: 3rem;
    position: relative;
}

.admin-header h1 {
    font-size: 2.75rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.admin-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* === PROFILE CARD === */
.profile-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.6s ease-out;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0.8;
}

.profile-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.1), transparent);
    pointer-events: none;
}

/* === PROFILE PICTURE === */
.profile-picture-container {
    position: relative;
    z-index: 1;
}

.profile-picture {
    width: 130px !important;
    height: 130px !important;
    border: 4px solid transparent !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3)) !important;
    background-clip: padding-box;
    position: relative;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
    animation: float 6s ease-in-out infinite;
}

.profile-picture::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--primary-gradient);
    z-index: -1;
}

.edit-picture-btn {
    background: var(--primary-gradient) !important;
    width: 40px !important;
    height: 40px !important;
    border: 3px solid rgba(15, 17, 25, 0.9) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease !important;
}

.edit-picture-btn:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.profile-info h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === SUBSCRIPTION BADGES === */
.subscription-badge {
    padding: 0.6rem 1.25rem !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.subscription-badge.free {
    background: linear-gradient(135deg, #475569, #334155) !important;
    color: #e2e8f0 !important;
}

.subscription-badge.silver {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.3);
}

.subscription-badge.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.subscription-badge.platinum {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(226, 232, 240, 0.3);
}

/* === PROFILE DETAILS === */
.profile-details {
    background: rgba(15, 17, 25, 0.6) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 14px !important;
    padding: 1.5rem !important;
    position: relative;
    z-index: 1;
}

.detail-row {
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08) !important;
    transition: all 0.2s ease;
}

.detail-row:hover {
    background: rgba(99, 102, 241, 0.05);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 8px;
}

.detail-label {
    color: var(--text-muted) !important;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* === SUBSCRIPTION KEY CARD === */
.subscription-key-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05)) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    border-radius: 16px !important;
    padding: 1.75rem !important;
    position: relative;
    z-index: 1;
}

.subscription-key-card h5 {
    color: var(--text-primary) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscription-key-card h5::before {
    content: '\f084';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #818cf8;
}

.subscription-key-input-group input {
    background: rgba(10, 12, 20, 0.8) !important;
    border: 2px solid var(--border-subtle) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease !important;
}

.subscription-key-input-group input:focus {
    border-color: var(--border-hover) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 0 20px rgba(99, 102, 241, 0.1) !important;
}

/* === ADMIN TABS === */
.admin-tabs {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    animation: slideInRight 0.6s ease-out 0.1s both;
}

.tab-nav {
    background: rgba(15, 17, 25, 0.6) !important;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.5rem 0.5rem 0;
    gap: 0.25rem;
}

.tab-nav button {
    padding: 1rem 1.5rem !important;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    transition: all 0.25s ease !important;
    border-bottom: 3px solid transparent !important;
    position: relative;
}

.tab-nav button:hover:not(.active) {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
}

.tab-nav button.active {
    color: #a78bfa !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08)) !important;
    border-bottom-color: #818cf8 !important;
}

.tab-content {
    padding: 2rem !important;
}

/* === STATS GRID === */
.stats-grid {
    gap: 1.25rem !important;
    margin-bottom: 2.5rem !important;
}

.stat-card {
    background: linear-gradient(145deg, rgba(23, 28, 45, 0.95) 0%, rgba(15, 20, 35, 0.98) 100%) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 16px !important;
    padding: 1.75rem !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15)) !important;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem !important;
    transition: all 0.3s ease;
}

.stat-card .stat-icon i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.stat-card .stat-value {
    font-size: 2rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--text-muted) !important;
    font-size: 0.9rem !important;
    font-weight: 500;
}

/* === APP CARDS === */
.app-card {
    background: linear-gradient(145deg, rgba(23, 28, 45, 0.95) 0%, rgba(15, 20, 35, 0.98) 100%) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-bottom: 1rem !important;
}

.app-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--border-hover) !important;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(99, 102, 241, 0.08) !important;
}

.app-image {
    width: 54px !important;
    height: 54px !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15)) !important;
    border: 2px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 12px !important;
}

.app-image i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem !important;
}

.edit-app-image-btn {
    background: var(--primary-gradient) !important;
    width: 24px !important;
    height: 24px !important;
    border: 2px solid rgba(15, 17, 25, 0.9) !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.app-card h5 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === BUTTONS === */
.btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent !important;
    border: 1px solid var(--border-hover) !important;
    color: var(--text-primary) !important;
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-small {
    padding: 0.6rem 1.15rem !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
}

/* === FORM ELEMENTS === */
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(15, 17, 25, 0.8) !important;
    border: 2px solid var(--border-subtle) !important;
    border-radius: 12px !important;
    padding: 0.9rem 1rem !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-hover) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

.form-group label {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    font-size: 0.9rem;
}

/* === MODALS === */
.modal {
    background: rgba(5, 5, 15, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 24px !important;
    padding: 2rem !important;
    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0.9;
}

.modal-content h3 {
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    border-radius: 10px !important;
    width: 38px !important;
    height: 38px !important;
    color: var(--text-secondary) !important;
    transition: all 0.25s ease !important;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
    transform: rotate(90deg);
}

/* === NOTIFICATIONS === */
.notification {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(139, 92, 246, 0.9)) !important;
    backdrop-filter: blur(10px);
    border-radius: 14px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
}

.notification.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.9)) !important;
}

.notification.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.9)) !important;
}

.notification.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(99, 102, 241, 0.9)) !important;
}

.notification-close {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    width: 26px !important;
    height: 26px !important;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* === PLAN OPTIONS === */
.plan-option {
    background: rgba(15, 17, 25, 0.6) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 14px !important;
    padding: 1.5rem !important;
    transition: all 0.3s ease !important;
}

.plan-option:hover {
    border-color: var(--border-hover) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* === THREAD MANAGEMENT === */
.thread-tabs {
    border-bottom: 2px solid var(--border-subtle) !important;
}

.thread-tab-btn {
    color: var(--text-secondary) !important;
    border-bottom: 3px solid transparent !important;
    transition: all 0.25s ease !important;
}

.thread-tab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
}

.thread-tab-btn.active {
    color: #a78bfa !important;
    border-bottom-color: #818cf8 !important;
}

.thread-management-item {
    background: rgba(15, 17, 25, 0.6) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.thread-management-item:hover {
    border-color: var(--border-hover) !important;
}

/* === CHECKBOX CUSTOM === */
.checkbox-custom {
    background: rgba(15, 17, 25, 0.8) !important;
    border: 2px solid var(--border-subtle) !important;
    border-radius: 6px !important;
    transition: all 0.25s ease !important;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-gradient) !important;
    border-color: #818cf8 !important;
}

/* === VARIABLES SECTION === */
.variables-empty-state {
    background: rgba(15, 17, 25, 0.4) !important;
    border: 1px dashed var(--border-subtle) !important;
    border-radius: 14px !important;
    padding: 2.5rem !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 17, 25, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* === SELECTION === */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #ffffff;
}

/* === LOADING SPINNER === */
.loading-spinner {
    border: 2px solid rgba(99, 102, 241, 0.2) !important;
    border-top-color: #818cf8 !important;
}

/* === FOCUS STATES === */
*:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* === COMPREHENSIVE MOBILE IMPROVEMENTS === */
@media (max-width: 1024px) {
    .admin-content {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        padding: 1rem !important;
    }

    .container {
        padding: 0 1rem !important;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        padding: 0.75rem 1rem !important;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-buttons {
        gap: 0.5rem !important;
    }

    .nav-buttons .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    /* Header */
    .admin-header {
        padding: 1.5rem 0 !important;
    }

    .admin-header h1 {
        font-size: 1.75rem !important;
    }

    .admin-header p {
        font-size: 0.9rem !important;
    }

    /* Cards */
    .card, .profile-card, .apps-card {
        padding: 1.25rem !important;
        border-radius: 16px !important;
        overflow: hidden;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .card-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Fix long text overflow */
    code {
        word-break: break-all !important;
        overflow-wrap: break-word !important;
        white-space: pre-wrap !important;
        max-width: 100% !important;
    }

    .app-id, .user-id, .key-value {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-all;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-value {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }

    /* App cards */
    .app-card {
        padding: 1rem !important;
        overflow: hidden;
    }

    .app-info {
        overflow: hidden;
    }

    .app-info h4 {
        font-size: 1rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-info p {
        word-break: break-all;
        font-size: 0.8rem !important;
    }

    /* Tab navigation */
    .tab-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.25rem;
    }

    .tab-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-nav button {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Buttons - larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem !important;
    }

    .btn-sm {
        min-height: 36px !important;
        padding: 0.4rem 0.75rem !important;
    }

    /* Form inputs */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    /* Modals */
    .modal-content {
        margin: 0.5rem !important;
        max-height: 95vh !important;
        border-radius: 16px !important;
        overflow-y: auto;
        width: calc(100% - 1rem) !important;
    }

    .modal-content h3 {
        font-size: 1.15rem !important;
        word-break: break-word;
    }

    /* Tables - horizontal scroll */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .logo {
        font-size: 1rem !important;
    }

    .logo i {
        font-size: 1.25rem !important;
    }

    .admin-header h1 {
        font-size: 1.5rem !important;
    }

    /* Stats - single column */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Bottom sheet modals */
    .modal-content {
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        max-height: 90vh !important;
        animation: slideUpModal 0.3s ease-out;
    }

    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Card actions - stack */
    .app-card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-card-actions .btn {
        width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover, .nav-link:hover, .app-card:hover {
        transform: none !important;
    }

    .btn, .nav-link, .app-card {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Larger tap targets */
    .nav-link {
        padding: 1rem !important;
    }
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-buttons {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(180deg, #1a1a1d 0%, #0f0f10 100%);
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 0.75rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .nav-buttons.active {
        right: 0;
    }

    .nav-buttons .btn {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.25rem !important;
        font-size: 1rem !important;
    }

    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    /* API Key containers - stack on mobile */
    .api-key-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .api-key-masked {
        width: 100%;
        font-size: 0.75rem !important;
    }

    .copy-btn {
        flex: 1;
        min-width: 40px;
    }

    /* Profile section improvements */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-avatar {
        margin: 0 auto;
    }

    .profile-details {
        grid-template-columns: 1fr !important;
    }

    /* Settings forms */
    .settings-form .form-group {
        margin-bottom: 1rem;
    }

    .settings-form label {
        font-size: 0.9rem;
    }

    /* Discord role mappings */
    .discord-role-mapping-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    /* Feature toggles */
    .feature-toggle-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .feature-toggle-item .toggle-switch {
        align-self: flex-end;
    }

    /* Subscription cards */
    .subscription-info {
        padding: 1rem !important;
    }

    .subscription-badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .admin-content {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .nav-buttons {
            padding-bottom: max(2rem, env(safe-area-inset-bottom));
        }
    }
}

/* Improve scrolling performance */
.admin-content, .modal-content, .tab-nav {
    -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }
}
