/* CSS Variables */
:root {
  --navbar-width: 256px;
  --navbar-width-min: 80px;
  --navbar-dark-primary-transculent: #18283bdd;
  --navbar-dark-primary: #18283b;
  --navbar-dark-secondary: #2c3e50;
  --navbar-light-primary: #f5f6fa;
  --navbar-light-secondary: #8392a5;
  --scrollbar-color: #a2a;
  /* --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  --svg-mask-corner-bottom: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"><path d="M0 1 Q1 1 1 0 L1 1"/></svg>');
  --svg-mask-corner-top: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"><path d="M0 0 Q1 0 1 1 L1 0"/></svg>');
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding-left: 280px;
    transition: padding-left .2s;
}

body.login-page {
    padding-left: 0;
}

/* Sidebar collapsed state */
body.sidebar-collapsed {
    padding-left: 100px;
}

body.sidebar-collapsed #nav-bar {
    width: 80px;
}

/* Default expanded state */
body:not(.sidebar-collapsed) {
    padding-left: 280px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 40px);
    position: relative;
    z-index: 1;
}

/* Remove old navbar styles */
.navbar {
    display: none;
}

/* Sidebar Navigation */

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    margin-right: 2rem;
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
}

.logo .moon {
    font-size: 1.8rem;
    animation: moonGlow 3s ease-in-out infinite alternate;
}

@keyframes moonGlow {
    0% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    100% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(102, 126, 234, 0.5); }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-main {
    flex: 1;
    justify-content: center;
}

.nav-main a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-main a:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.nav-main a.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.nav-user {
    gap: 1rem;
}

.nav-user a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-user a:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.nav-user a.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #667eea;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

/* Notifications */
.notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
}

.notification-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.notification-item.unread {
    border-left-color: #28a745;
    background: #f8fff9;
}

.notification-item.read {
    opacity: 0.7;
    border-left-color: #6c757d;
}

.notification-content {
    flex: 1;
}

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

.notification-title {
    font-size: 1rem;
    color: #333;
}

.notification-type {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-success {
    background: #d4edda;
    color: #155724;
}

.type-warning {
    background: #fff3cd;
    color: #856404;
}

.type-error {
    background: #f8d7da;
    color: #721c24;
}

.type-info {
    background: #d1ecf1;
    color: #0c5460;
}

.notification-message {
    margin: 0.5rem 0;
    color: #666;
    line-height: 1.4;
}

.notification-time {
    color: #999;
    font-size: 0.875rem;
}

.notification-actions {
    margin-left: 1rem;
}

.notifications-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Admin Logs */
.logs-container {
    max-height: 600px;
    overflow-y: auto;
}

.log-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

.log-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.log-admin {
    font-weight: bold;
    color: #667eea;
}

.log-action {
    background: #4949495e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.log-target {
    color: #6c757d;
}

.log-details {
    margin: 0.5rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.log-time {
    font-size: 0.875rem;
    color: #999;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    background: #2d3748 !important;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #4a5568;
}

.setting-item label {
    font-weight: 600;
    color: #cbd5e0 !important;
    margin-bottom: 0.25rem;
}

.setting-item small {
    color: #a0aec0 !important;
    display: block;
    margin-bottom: 0.5rem;
}

.setting-item input,
.setting-item select,
.setting-item textarea {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
    border: 1px solid #718096 !important;
}

.setting-item input:focus,
.setting-item select:focus,
.setting-item textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

/* Stats Placeholder */
.stats-placeholder {
    text-align: center;
    padding: 2rem;
}

.stats-placeholder ul {
    text-align: left;
    max-width: 400px;
    margin: 1rem auto;
}

.stats-placeholder li {
    padding: 0.25rem 0;
    color: #6c757d;
}

/* Package Management */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.package-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Login/Register Page Styles */
.login-page {
    padding-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-container a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-container a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.btn-discord {
    background: #5865F2 !important;
    color: white !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-discord:hover {
    background: #4752C4 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
    color: white !important;
    text-decoration: none;
}

.package-header h4 {
    margin: 0;
    color: #333;
}

.package-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.package-status.active {
    background: #d4edda;
    color: #155724;
}

.package-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.package-details {
    margin: 1rem 0;
    display: grid;
    gap: 0.5rem;
}

.package-details div {
    padding: 0.25rem 0;
    border-bottom: none;
}

.package-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.package-actions .btn {
    flex: 1;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    margin: 0.5rem 0;
    gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #667eea !important;
    margin: 0 !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    background: white !important;
    border: 2px solid #718096 !important;
}

.checkbox-text {
    cursor: pointer;
    user-select: none;
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color, #555);
}

.setting-item h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0 !important;
}

.setting-item h6 {
    color: #cbd5e0 !important;
    margin-bottom: 0.5rem;
}

.setting-item p {
    color: #a0aec0 !important;
    margin: 0.5rem 0;
}

.setting-item a {
    color: #667eea !important;
}

.setting-item code {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
    padding: 2px 6px;
    border-radius: 4px;
}

.setting-item ol {
    color: #a0aec0 !important;
}

.setting-item strong {
    color: #cbd5e0 !important;
}

.setting-item div[style*="background: #e3f2fd"] {
    background: #2b6cb0 !important;
    color: #e2e8f0 !important;
}

.setting-item div[style*="background: #f3e5f5"] {
    background: #553c9a !important;
    color: #e2e8f0 !important;
}

/* Security Documentation Tab */
.card h4 {
    color: #e2e8f0 !important;
}

.card p {
    color: #a0aec0 !important;
}

.card h5 {
    color: #cbd5e0 !important;
}

.card div[style*="background: #f8f9fa"] {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
}

.card code {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border: 1px solid #718096;
}

.card small {
    color: #a0aec0 !important;
}

.card strong {
    color: #cbd5e0 !important;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-left: 0 !important;
}

.login-container {
    background: #18181866;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #767676;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Bot Status */
.bot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bot-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Disabled Page Indicator */
.disabled-indicator {
    color: #dc3545;
    font-size: 0.8em;
    margin-left: 4px;
    opacity: 0.8;
}

/* Deletion Request Cards */
.deletion-request-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.deletion-request-card.pending {
    border-left: 4px solid #e53e3e;
}

.deletion-request-card.processed {
    border-left: 4px solid #718096 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    opacity: 0.9 !important;
    background: white !important;
    color: #333 !important;
}

.deletion-request-card.processed * {
    color: #333 !important;
}

.deletion-request-card.processed.approved {
    border-left: 4px solid #38a169 !important;
    background: white !important;
}

.deletion-request-card.approved {
    border-left: 4px solid #38a169;
}

/* API Documentation */
.api-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.endpoint {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.endpoint h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
}

.endpoint pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.token-manager {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}

.token-item button {
    padding: 4px 12px;
    font-size: 0.875rem;
}

/* Modal Styling - Dark Theme */
#createRoleModal > div {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
}

#createRoleModal h3 {
    color: #e2e8f0 !important;
    margin-bottom: 1.5rem;
}

#createRoleModal label {
    color: #cbd5e0 !important;
    font-weight: 600;
}

#createRoleModal small {
    color: #a0aec0 !important;
}

#createRoleModal .form-control {
    color: #e2e8f0 !important;
    background: #4a5568 !important;
    border: 1px solid #718096 !important;
}

#createRoleModal .form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3) !important;
}

#createRoleModal select option {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
}

#createRoleModal div[style*="background: #f9f9f9"] {
    background: #4a5568 !important;
    border-color: #718096 !important;
    color: #e2e8f0 !important;
}

#createRoleModal #rolePreview {
    color: #667eea !important;
}

#createRoleModal input[name="permissions[]"] {
    width: 18px !important;
    height: 18px !important;
    margin-right: 8px !important;
    accent-color: #667eea !important;
    cursor: pointer !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

#createRoleModal label:has(input[name="permissions[]"]) {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    color: #cbd5e0 !important;
    font-weight: normal !important;
    margin-bottom: 0.5rem !important;
    padding: 4px 0 !important;
}

/* Role Effects */
.role-rainbow-text {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s ease-in-out infinite;
}

.role-static_border {
    border: 2px solid currentColor !important;
    padding: 2px 6px;
    border-radius: 4px;
}

.role-glow_border {
    border: 2px solid currentColor !important;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 0 10px currentColor;
}

.role-rainbow_border {
    border: 2px solid;
    padding: 2px 6px;
    border-radius: 4px;
    border-image: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3) 1;
    animation: rainbow-border 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes rainbow-border {
    0%, 100% { border-image-source: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3); }
    25% { border-image-source: linear-gradient(45deg, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000); }
    50% { border-image-source: linear-gradient(45deg, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000, #ff7f00); }
    75% { border-image-source: linear-gradient(45deg, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000, #ff7f00, #ffff00); }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        margin: 20px;
        padding: 2rem;
    }
}