/* =========================================
   1. VARIABLES & RESET (The Foundation)
   ========================================= */
:root {
    --primary-color: #003366;    /* Navy Blue */
    --primary-light: #004080;    /* Lighter Navy for hover */
    --accent-color: #ffcc00;     /* Gold */
    --bg-color: #f4f7f6;         /* Light Grey Background */
    --text-color: #333333;       /* Dark Grey Text */
    --white: #ffffff;
    --danger: #dc3545;           /* Red for Logout/Reject */
    --success: #28a745;          /* Green for Approve */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Soft Shadow */
    --radius: 12px;              /* Rounded Corners */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif; /* Modern Font */
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* =========================================
   2. TOP BAR (Header)
   ========================================= */
.top-bar {
    background-color: var(--white);
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Hamburger */
.mobile-toggle {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--primary-color);
    transition: transform 0.2s;
}
.mobile-toggle:active { transform: scale(0.9); }

/* Settings Icon */
.settings-container { position: relative; }
.settings-icon { 
    font-size: 22px; cursor: pointer; color: var(--text-color); 
    padding: 8px; border-radius: 50%; transition: 0.3s;
}
.settings-icon:hover { background-color: #eee; transform: rotate(90deg); }

/* Dropdown Menu */
.dropdown-menu {
    display: none; position: absolute; right: 0; top: 50px;
    background: var(--white); min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: var(--radius); z-index: 1001; 
    border: 1px solid #eee; overflow: hidden;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

.dropdown-menu a {
    display: block; padding: 12px 20px; color: var(--text-color); 
    text-decoration: none; font-size: 14px; transition: 0.2s;
    border-bottom: 1px solid #f9f9f9;
}
.dropdown-menu a:hover { background: #f8f9fa; color: var(--primary-color); }
.show-menu { display: block; }

/* =========================================
   3. SIDEBAR (Navigation)
   ========================================= */
.dashboard-wrapper { display: flex; min-height: calc(100vh - 70px); position: relative; }

.sidebar {
    width: 280px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
}

.sidebar-header {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 20px;
    padding-left: 10px;
    font-weight: bold;
}

/* Sidebar Buttons */
.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(5px);
}

.nav-btn.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.3);
}

/* LOGOUT BUTTON (The New Pro Button) */
.logout-btn {
    margin-top: auto; /* Pushes to bottom */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: rgba(220, 53, 69, 0.15); /* Transparent Red */
    color: #ffadb4;
    padding: 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* =========================================
   4. MAIN CONTENT
   ========================================= */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    width: 100%;
}

.tab-content { display: none; animation: fadeIn 0.4s ease-out; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Headings */
.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 25px;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}

/* =========================================
   5. CARDS & UI ELEMENTS
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.peer-card, .request-card, .form-card, .admin-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.peer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.peer-card {
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 4px solid var(--primary-color);
}

.card-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-alias {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.card-details {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Buttons inside cards */
.btn-action {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    transition: 0.3s;
    margin-top: 10px;
    border: none;
    cursor: pointer;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-light); transform: translateY(-2px); }

/* =========================================
   6. TABLES (Admin)
   ========================================= */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 18px;
    text-align: left;
    font-weight: 600;
}
.admin-table td {
    padding: 18px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}
.admin-table tr:hover { background-color: #f9fbff; }

/* =========================================
   7. CHAT & FAQ
   ========================================= */
.chat-container, .faq-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.chat-header, .faq-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    font-weight: bold;
    font-size: 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.chat-body, .faq-body {
    flex: 1; padding: 25px; overflow-y: auto;
    background: #f8f9fa;
    display: flex; flex-direction: column; gap: 15px;
}
.chat-bubble {
    padding: 12px 20px;
    border-radius: 18px;
    font-size: 15px;
    max-width: 75%;
    line-height: 1.5;
    position: relative;
}
.bubble-blue { 
    background: var(--primary-color); 
    color: white; 
    border-bottom-right-radius: 2px;
}
.bubble-gray { 
    background: #e9ecef; 
    color: #333; 
    border-bottom-left-radius: 2px;
}

/* =========================================
   8. DARK MODE
   ========================================= */
body.dark-mode { --bg-color: #121212; --text-color: #e0e0e0; --white: #1e1e1e; --primary-color: #0d1b2a; --primary-light: #1b263b; }
body.dark-mode .sidebar { background-color: #0a0a0a; border-right: 1px solid #333; }
body.dark-mode .peer-card, body.dark-mode .admin-table, body.dark-mode .chat-container { border: 1px solid #333; }
body.dark-mode .admin-table tr:hover { background-color: #2c2c2c; }
body.dark-mode .mobile-toggle { color: var(--accent-color); }

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .dashboard-wrapper { flex-direction: column; }
    .top-bar { padding: 0 15px; }
    .mobile-toggle { display: block; }
    
    .sidebar {
        position: fixed; left: -100%; top: 70px;
        height: calc(100vh - 70px); width: 100%;
        z-index: 999;
    }
    .sidebar.active { left: 0; }
    
    .main-content { padding: 20px 15px; }
    .card-grid { grid-template-columns: 1fr; }
    
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .chat-bubble { max-width: 85%; }
    
    #socials div[style*="width: 700px"] { width: 100% !important; flex-direction: column; text-align: center; }
}