/*
 * PeRP! Custom Styles - Bootstrap 5 First Approach
 *
 * This file contains ONLY custom styles specific to PeRP!
 * All standard UI elements use Bootstrap 5 classes directly in HTML
 */

/* ============================================
   GLOBAL STYLES
   ============================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Add top padding when sticky header is present */
body.has-sticky-header {
    padding-top: 70px;
}

/* ============================================
   STICKY HEADER (Custom Component)
   ============================================ */

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #2c3e50;
    color: white;
    z-index: 1050;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.header-left img,
.header-right img {
    max-height: 40px;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* User Dropdown in Header */
.user-dropdown {
    position: relative;
}

.user-dropdown .user-info {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown .user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown .user-name {
    color: #ecf0f1;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-caret {
    color: #ecf0f1;
    font-size: 12px;
    transition: transform 0.2s;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1051;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background-color 0.2s;
}

.user-dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

/* Context Selector in Header */
.context-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-selector label {
    color: #ecf0f1;
    font-size: 14px;
    margin: 0;
}

.context-selector select {
    padding: 5px 10px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    font-size: 14px;
}

.context-selector select:focus {
    outline: none;
    border-color: #3498db;
}

/* Trash Icon Button */
.trash-icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.trash-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Remove default dropdown caret since we're using an icon */
.theme-toggle-btn.dropdown-toggle::after {
    display: none;
}

/* ============================================
   DASHBOARD & MODULE NAVIGATION
   ============================================ */

.dashboard-logo {
    text-align: center;
    margin: 40px 0;
}

.dashboard-logo img {
    max-width: 200px;
    width: 100%;
    height: auto;
}

/* Modules Navigation Grid */
.modules-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.module-nav-item {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.module-nav-item:hover {
    background-color: #e7f3ff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.module-nav-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.module-nav-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

/* Add Module Button */
.module-nav-item.add-module {
    background-color: #f0f8f0;
    border: 2px dashed #6c757d;
    color: #6c757d;
}

.module-nav-item.add-module:hover {
    background-color: #e8f5e8;
    border-color: #28a745;
    color: #28a745;
}

.add-module-icon {
    font-size: 3em !important;
    font-weight: bold;
}

/* ============================================
   TRASH VIEW
   ============================================ */

.trash-view {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    margin-top: 20px;
}

.trash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.trash-header h2 {
    margin: 0;
    color: #2c3e50;
}

.trash-actions {
    display: flex;
    gap: 10px;
}

.trash-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.trash-empty p:first-child {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.trash-empty-subtitle {
    font-size: 0.95em;
    color: #adb5bd;
}

/* ============================================
   MODULE MANAGEMENT
   ============================================ */

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.module-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.module-card.enabled {
    border-color: #28a745;
    background-color: #f8fff8;
}

.module-card .module-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.module-version {
    font-size: 0.85em;
    color: #6c757d;
}

/* ============================================
   PROFILE VIEW & SETTINGS
   ============================================ */

.profile-view,
.profile-settings {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    margin-top: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.profile-header h2 {
    margin: 0;
    color: #2c3e50;
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.profile-info-card {
    display: flex;
    gap: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img,
.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.profile-details {
    flex-grow: 1;
}

.profile-details h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.profile-username {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.profile-bio {
    font-style: italic;
    color: #6c757d;
    margin-bottom: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.profile-fields {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.profile-fields .mb-3 {
    padding: 8px 0;
}

/* Profile Settings */
.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.settings-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.settings-section form {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }

    .modules-nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .module-nav-item {
        padding: 15px;
        min-height: 100px;
    }

    .module-nav-icon {
        font-size: 2em;
    }

    .trash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .trash-actions {
        width: 100%;
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .profile-actions {
        width: 100%;
        flex-direction: column;
    }

    .profile-info-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-view,
    .profile-settings {
        padding: 20px 15px;
    }
}

/* Blocked Users Page */
.blocked-users-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.page-header h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.blocked-users-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    body.has-sticky-header {
        padding-top: 90px; /* More space for multi-line header on mobile */
    }

    .modules-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

[data-bs-theme="dark"] body {
    background-color: #1a1d20;
    color: #e9ecef;
}

/* Module Navigation Cards in Dark Mode */
[data-bs-theme="dark"] .module-nav-item {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .module-nav-item:hover {
    background-color: #1e3a5f;
    border-color: #3498db;
}

[data-bs-theme="dark"] .module-nav-icon {
    color: #e9ecef;
}

[data-bs-theme="dark"] .module-nav-name {
    color: #e9ecef;
}

/* Add Module Button in Dark Mode */
[data-bs-theme="dark"] .module-nav-item.add-module {
    background-color: #1e2d1e;
    border-color: #6c757d;
    color: #adb5bd;
}

[data-bs-theme="dark"] .module-nav-item.add-module:hover {
    background-color: #2d3e2d;
    border-color: #28a745;
    color: #28a745;
}

/* User Dropdown Menu in Dark Mode */
[data-bs-theme="dark"] .user-dropdown-menu {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .user-dropdown-menu a {
    color: #e9ecef;
}

[data-bs-theme="dark"] .user-dropdown-menu a:hover {
    background-color: #1a1d20;
}

[data-bs-theme="dark"] .dropdown-divider {
    background-color: #495057;
}

/* Trash View in Dark Mode */
[data-bs-theme="dark"] .trash-view {
    background-color: #2b3035;
    color: #e9ecef;
}

[data-bs-theme="dark"] .trash-header h2 {
    color: #e9ecef;
}

[data-bs-theme="dark"] .trash-header {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .trash-empty {
    color: #adb5bd;
}

[data-bs-theme="dark"] .trash-empty-subtitle {
    color: #6c757d;
}

/* Module Management in Dark Mode */
[data-bs-theme="dark"] .module-card {
    background-color: #2b3035;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .module-card.enabled {
    background-color: #1e2d1e;
    border-color: #28a745;
}

[data-bs-theme="dark"] .module-version {
    color: #adb5bd;
}

/* Profile View in Dark Mode */
[data-bs-theme="dark"] .profile-view,
[data-bs-theme="dark"] .profile-settings {
    background-color: #2b3035;
    color: #e9ecef;
}

[data-bs-theme="dark"] .profile-header {
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .profile-header h2 {
    color: #e9ecef;
}

[data-bs-theme="dark"] .profile-info-card {
    background-color: #1a1d20;
}

[data-bs-theme="dark"] .profile-details h3 {
    color: #e9ecef;
}

[data-bs-theme="dark"] .profile-bio {
    background-color: #2b3035;
    color: #adb5bd;
    border-left-color: #3498db;
}

[data-bs-theme="dark"] .profile-fields {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .avatar-placeholder {
    background-color: #495057;
}

/* Settings Sections in Dark Mode */
[data-bs-theme="dark"] .settings-section {
    background-color: #1a1d20;
}

[data-bs-theme="dark"] .settings-section h4 {
    color: #e9ecef;
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .settings-section form {
    background-color: #2b3035;
}
