/* ========================================
   ROLAND TRADING - MAIN STYLES
   ======================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-900);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dark body for trading platform feel */
body.dark-theme {
  background-color: var(--secondary);
  color: var(--gray-100);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); }
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== NAVBAR ===== */
.navbar-roland {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--secondary-lighter);
  padding: var(--space-4) 0;
  transition: var(--transition-base);
}

.navbar-roland .navbar-brand {
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-roland .navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.navbar-roland .nav-link {
  color: var(--gray-300);
  font-weight: var(--font-medium);
  padding: var(--space-2) var(--space-4);
  transition: var(--transition-fast);
  position: relative;
}

.navbar-roland .nav-link:hover,
.navbar-roland .nav-link.active {
  color: var(--white);
}

.navbar-roland .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font-primary);
  font-weight: var(--font-semibold);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: var(--white);
}

.btn-secondary {
  background: var(--secondary-light);
  color: var(--white);
  border: 1px solid var(--secondary-lighter);
}

.btn-secondary:hover {
  background: var(--secondary-lighter);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-gold {
  background: var(--gradient-gold);
  color: var(--secondary);
  font-weight: var(--font-bold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
  color: var(--secondary);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* ===== CARDS ===== */
.card-roland {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: var(--transition-base);
}

.card-roland:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-dark {
  background: var(--secondary-light);
  border-color: var(--secondary-lighter);
}

.card-dark:hover {
  border-color: var(--primary);
}

/* Contest Card */
.contest-card {
  background: var(--secondary-light);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.contest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-fast);
}

.contest-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.contest-card:hover::before {
  opacity: 1;
}

.contest-card .prize-badge {
  background: var(--gradient-gold);
  color: var(--secondary);
  font-weight: var(--font-bold);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.contest-card .status-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: var(--success-light);
  color: var(--success);
}

.status-upcoming {
  background: var(--info-light);
  color: var(--info);
}

.status-ended {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* ===== HERO SECTION ===== */
.hero-section {
  background: var(--gradient-hero);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-section .hero-title {
  font-size: var(--text-6xl);
  font-weight: var(--font-extrabold);
  color: var(--white);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .hero-section .hero-title {
    font-size: var(--text-4xl);
  }
}

.hero-section .hero-subtitle {
  font-size: var(--text-xl);
  color: var(--gray-400);
  margin-bottom: var(--space-8);
  max-width: 600px;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-value {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  color: var(--white);
}

.hero-stat .stat-label {
  font-size: var(--text-sm);
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--space-20) 0;
}

.section-dark {
  background: var(--secondary);
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--gray-500);
  margin-bottom: var(--space-12);
}

.section-dark .section-title {
  color: var(--white);
}

.section-dark .section-subtitle {
  color: var(--gray-400);
}

/* ===== HOW IT WORKS ===== */
.step-card {
  text-align: center;
  padding: var(--space-8);
}

.step-number {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--white);
  margin: 0 auto var(--space-6);
  box-shadow: var(--shadow-glow);
}

.step-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--white);
  margin-bottom: var(--space-3);
}

.step-description {
  color: var(--gray-400);
  font-size: var(--text-base);
}

/* ===== RANKINGS / LEADERBOARD ===== */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.podium-place {
  text-align: center;
  padding: var(--space-6);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  position: relative;
}

.podium-place.first {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, transparent 100%);
  border: 1px solid var(--accent-gold);
  border-bottom: none;
  min-height: 200px;
  order: 2;
}

.podium-place.second {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.2) 0%, transparent 100%);
  border: 1px solid var(--gray-400);
  border-bottom: none;
  min-height: 160px;
  order: 1;
}

.podium-place.third {
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.2) 0%, transparent 100%);
  border: 1px solid #B45309;
  border-bottom: none;
  min-height: 120px;
  order: 3;
}

.podium-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  border: 3px solid;
  margin: 0 auto var(--space-3);
  overflow: hidden;
  background: var(--secondary-lighter);
}

.podium-place.first .podium-avatar {
  border-color: var(--accent-gold);
  width: 100px;
  height: 100px;
}

.podium-place.second .podium-avatar {
  border-color: var(--gray-400);
}

.podium-place.third .podium-avatar {
  border-color: #B45309;
}

.podium-rank {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-2);
}

.podium-place.first .podium-rank {
  color: var(--accent-gold);
}

.podium-place.second .podium-rank {
  color: var(--gray-400);
}

.podium-place.third .podium-rank {
  color: #B45309;
}

.podium-name {
  color: var(--white);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.podium-profit {
  color: var(--success);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
}

/* Leaderboard Table */
.leaderboard-table {
  background: var(--secondary-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.leaderboard-table table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  background: var(--secondary);
  color: var(--gray-400);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 1px;
  padding: var(--space-4) var(--space-6);
  text-align: left;
}

.leaderboard-table td {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--secondary-lighter);
  color: var(--gray-300);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
}

.rank-1 { background: var(--accent-gold); color: var(--secondary); }
.rank-2 { background: var(--gray-400); color: var(--secondary); }
.rank-3 { background: #B45309; color: var(--white); }
.rank-default { background: var(--secondary-lighter); color: var(--gray-400); }

/* ===== FORMS ===== */
.form-control-roland {
  background: var(--secondary-light);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: var(--white);
  font-size: var(--text-base);
  transition: var(--transition-fast);
}

.form-control-roland:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control-roland::placeholder {
  color: var(--gray-500);
}

.form-label-roland {
  color: var(--gray-300);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
  display: block;
}

.form-select-roland {
  background: var(--secondary-light) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394A3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 1rem center/12px 12px;
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  padding-right: var(--space-10);
  color: var(--white);
  font-size: var(--text-base);
  appearance: none;
  cursor: pointer;
}

/* ===== AUTH PAGES ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  padding: var(--space-6);
}

.auth-card {
  background: var(--secondary-light);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-title {
  color: var(--white);
  font-size: var(--text-2xl);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  color: var(--gray-400);
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--gray-500);
  font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--secondary-lighter);
}

/* ===== DASHBOARD ===== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 280px;
  background: var(--secondary);
  border-right: 1px solid var(--secondary-lighter);
  padding: var(--space-6);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.dashboard-main {
  flex: 1;
  margin-left: 280px;
  background: var(--secondary-light);
  min-height: 100vh;
}

@media (max-width: 992px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    z-index: var(--z-fixed);
    transition: var(--transition-base);
  }
  
  .dashboard-sidebar.show {
    transform: translateX(0);
  }
  
  .dashboard-main {
    margin-left: 0;
  }
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--gray-400);
  text-decoration: none;
  transition: var(--transition-fast);
  margin-bottom: var(--space-1);
}

.sidebar-nav-item:hover {
  background: var(--secondary-light);
  color: var(--white);
}

.sidebar-nav-item.active {
  background: var(--primary);
  color: var(--white);
}

/* Stats Cards */
.stat-card {
  background: var(--secondary);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.stat-card .stat-icon.primary {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.stat-card .stat-icon.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.stat-card .stat-icon.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--white);
  margin-bottom: var(--space-1);
}

.stat-card .stat-label {
  color: var(--gray-400);
  font-size: var(--text-sm);
}

/* ===== FOOTER ===== */
.footer-roland {
  background: var(--secondary);
  border-top: 1px solid var(--secondary-lighter);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  color: var(--white);
  margin-bottom: var(--space-4);
}

.footer-description {
  color: var(--gray-400);
  margin-bottom: var(--space-6);
  max-width: 300px;
}

.footer-title {
  color: var(--white);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-3);
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--secondary-lighter);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copyright {
  color: var(--gray-500);
  font-size: var(--text-sm);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--secondary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary);
  color: var(--white);
}

/* ===== UTILITIES ===== */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-white { color: var(--white) !important; }

.bg-success-subtle { background: var(--success-light) !important; }
.bg-danger-subtle { background: var(--danger-light) !important; }
.bg-warning-subtle { background: var(--warning-light) !important; }

/* Profit/Loss indicators */
.profit-positive {
  color: var(--success);
}

.profit-positive::before {
  content: '+';
}

.profit-negative {
  color: var(--danger);
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--secondary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-weight: var(--font-semibold);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: var(--text-xl);
}

.avatar-xl {
  width: 100px;
  height: 100px;
  font-size: var(--text-3xl);
}

/* Badges */
.badge-roland {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg, var(--secondary-lighter) 25%, var(--secondary-light) 50%, var(--secondary-lighter) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast Notifications */
.toast-roland {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--secondary-light);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-tooltip);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-base);
}

.toast-roland.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-roland.success {
  border-left: 4px solid var(--success);
}

.toast-roland.error {
  border-left: 4px solid var(--danger);
}

/* Filters */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.filter-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--secondary-light);
  border: 1px solid var(--secondary-lighter);
  color: var(--gray-400);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--white);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Progress Bar */
.progress-roland {
  height: 8px;
  background: var(--secondary-lighter);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-roland .progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Countdown Timer */
.countdown {
  display: flex;
  gap: var(--space-4);
}

.countdown-item {
  text-align: center;
}

.countdown-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--white);
  background: var(--secondary);
  border: 1px solid var(--secondary-lighter);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  min-width: 70px;
}

.countdown-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  margin-top: var(--space-2);
}
