/* Empires Markets Platform - Main CSS Entry Point */
/* Unified Design System - Modular Architecture */
/* Version: 2.0 - Refactored October 2025 */

/* ========================================
   CORE STYLES
   Base styles, variables, and typography
   ======================================== */

@import 'core/reset.css';
@import 'core/variables.css';
@import 'core/typography.css';
@import 'core/utilities.css';

/* ========================================
   LAYOUT COMPONENTS
   Header, sidebar, grid system
   ======================================== */

@import 'layout/header.css';
@import 'layout/grid.css';

/* ========================================
   UI COMPONENTS
   Reusable interface components
   ======================================== */

@import 'components/navigation.css';
@import 'components/buttons.css';
@import 'components/cards.css';
@import 'components/forms.css';
@import 'components/tables.css';
@import 'components/modals.css';
@import 'components/admin-layout.css';
@import 'components/admin-components.css';
@import 'components/user-details.css';

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */

.main-content {
  margin-left: 0;
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
  transition: margin-left var(--transition-slow);
}

.dashboard-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.admin-content {
  padding: var(--space-8);
}

/* Desktop Layout - Sidebar Visible */
@media (min-width: 1024px) {
  .main-content {
    margin-left: var(--sidebar-width);
  }
}

/* Mobile Layout */
@media (max-width: 1023px) {
  .main-content {
    margin-left: 0;
    padding: var(--space-4) var(--space-3);
  }
  
  .admin-content {
    padding: var(--space-5);
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: var(--space-3) var(--space-2);
  }
  
  .admin-content {
    padding: var(--space-4);
  }
}

/* ========================================
   ADMIN LAYOUT
   ======================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.admin-body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Admin sidebar and main styles moved to admin-layout.css */

.admin-brand {
  padding: var(--space-5);
  text-align: center;
  border-bottom: 1px solid var(--border-color-light);
}

.admin-brand h3 {
  color: var(--color-accent-red);
  font-size: var(--font-size-xl);
  margin: 0;
}

/* Admin nav styles moved to admin-layout.css */

/* Mobile Admin Layout - REMOVED - Handled in admin-layout.css */

/* ========================================
   AUTH PAGES
   ======================================== */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-gradient);
  padding: var(--space-4);
}

.admin-login-body {
  font-family: var(--font-primary);
  background: var(--bg-gradient);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-5);
}

.admin-login-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color-light);
}

.admin-login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.admin-login-header .admin-logo {
  margin-bottom: var(--space-5);
}

.admin-login-header .admin-logo i {
  font-size: var(--font-size-4xl);
  color: var(--color-accent-red);
  margin-bottom: var(--space-2);
}

.admin-login-header h2 {
  color: var(--text-primary);
  margin: var(--space-2) 0;
  font-size: clamp(1.5rem, 4vw, 1.8rem);
}

.admin-login-header p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

.admin-login-form {
  margin-bottom: var(--space-5);
}

.admin-login-footer {
  text-align: center;
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-color-light);
}

.admin-login-footer p {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin: 0;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background: rgba(26, 31, 46, 0.8);
  border-top: 1px solid var(--border-color-light);
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  margin-top: var(--space-8);
}

.footer p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* ========================================
   PAGINATION
   ======================================== */

.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

.admin-pagination a,
.admin-pagination span {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  min-width: 40px;
  text-align: center;
}

.admin-pagination a:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.admin-pagination .current {
  background-color: var(--color-accent-red);
  color: var(--color-white);
  border-color: var(--color-accent-red);
}

/* ========================================
   CHAT WIDGET
   ======================================== */

.chat-widget {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-fixed);
}

.chat-button {
  background-color: var(--color-accent-blue);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  width: 60px;
  height: 60px;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.chat-button:hover {
  background-color: var(--color-accent-blue-hover);
  transform: scale(1.1);
}

.chat-popup {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 300px;
  height: 400px;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color-light);
  box-shadow: var(--shadow-xl);
  display: none;
}

.chat-popup.active {
  display: block;
}

.chat-header {
  background-color: var(--color-accent-blue);
  color: var(--color-white);
  padding: var(--space-4);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-close {
  background: none;
  border: none;
  color: var(--color-white);
  font-size: var(--font-size-xl);
  cursor: pointer;
}

.chat-body {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .chat-popup {
    width: 280px;
    height: 350px;
    right: -10px;
  }
}

/* ========================================
   SPECIAL COMPONENTS
   ======================================== */

/* Transaction Styles */
.transaction-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
}

.transaction-type.deposit,
.transaction-type.credit {
  background-color: rgba(39, 174, 96, 0.1);
  color: var(--color-success);
}

.transaction-type.withdrawal,
.transaction-type.debit {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--color-danger);
}

.transaction-type.trade {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--color-info);
}

.transaction-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.transaction-date {
  font-size: var(--font-size-sm);
}

.transaction-date small {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

/* Role Badge */
.role-badge {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  display: inline-block;
}

.role-badge.admin {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--color-info);
}

.role-badge.super-admin {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--color-danger);
}

/* Trade Type */
.trade-type {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  display: inline-block;
}

.trade-type.buy {
  background-color: rgba(39, 174, 96, 0.1);
  color: var(--color-success);
}

.trade-type.sell {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--color-danger);
}

/* Level Section */
.level-section {
  margin-bottom: var(--space-8);
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .sidebar,
  .admin-sidebar,
  .header,
  .admin-header,
  .menu-toggle,
  .nav-icons,
  .chat-widget,
  .footer {
    display: none;
  }
  
  .main-content,
  .admin-main {
    margin-left: 0;
    padding: 0;
  }
  
  body {
    background: white;
    color: black;
  }
}
