/* ==================== Font Face ==================== */
@font-face {
  font-family: 'IRANSans';
  src: url('./Iran Sans/iran-sans.eot');
  src: url('./Iran Sans/iran-sans.eot?#iefix') format('embedded-opentype'),
       url('./Iran Sans/iran-sans.woff') format('woff'),
       url('./Iran Sans/iran-sans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
/* ==================== CSS Variables ==================== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  --border-color: #dee2e6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --accent-primary: #3498db;
  --accent-secondary: #2ecc71;
  --accent-gradient: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
  --pink-pulse-1: #ffc0cb;
  --pink-pulse-2: #ff8ac9;
}

[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #13131a;
  --bg-tertiary: #1a1a24;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --pink-pulse-1: #c084fc;
  --pink-pulse-2: #a855f7;
}

/* ==================== Global Styles ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'IRANSans', Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
  direction: rtl;
}

/* ==================== Theme Toggle ==================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  -webkit-user-select: none;
  user-select: none;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-toggle-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

.theme-toggle-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== Wrapper ==================== */
.wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
}

/* ==================== Content Box ==================== */
.content-box {
  width: 360px;
  padding: 60px 30px 30px 30px;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  opacity: 0;
  transform: translateX(0);
  animation: slideRight 0.9s ease-out forwards;
  animation-delay: 0.2s;
}

.content-box h2 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 24px;
}

.content-box p {
  color: var(--text-secondary);
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.6;
}

/* ==================== Floating Logo ==================== */
.box-logo {
  width: 80px;
  height: 80px;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
  filter: drop-shadow(var(--shadow-sm));
}

@keyframes float {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-15px); }
  100% { transform: translateX(-50%) translateY(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(0); }
  to { opacity: 1; transform: translateX(250px); }
}

@keyframes pinkPulse {
  0% { background: var(--pink-pulse-1); }
  50% { background: var(--pink-pulse-2); }
  100% { background: var(--pink-pulse-1); }
}

/* ==================== Buttons ==================== */
.content-box button {
  display: block;
  width: 85%;
  margin: 12px auto;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  font-family: 'IRANSans', Arial, sans-serif;
}

.content-box button:first-of-type {
  background: var(--pink-pulse-1);
  animation: pinkPulse 1.5s ease-in-out infinite;
  border-color: transparent;
}

.content-box button:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.content-box button:active {
  transform: translateY(0);
}

/* ==================== Music Card ==================== */
.music-card {
  display: flex;
  align-items: center;
  cursor: pointer;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.3s ease;
  margin: 20px auto 0 auto;
  width: 90%;
  background: var(--bg-tertiary);
}

.music-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.music-card img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  margin-left: 15px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.music-info { 
  flex-grow: 1; 
  text-align: right; 
}

.music-info div:first-child {
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.music-info div:last-child {
  font-size: 14px;
  color: var(--text-secondary);
}

.music-controls { 
  font-size: 20px; 
  display: flex; 
  gap: 5px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.music-card:hover .music-controls {
  opacity: 1;
}

/* ==================== Form Inputs ==================== */
.reg-input {
  width: 90%;
  padding: 14px;
  margin: 10px 0;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-family: 'IRANSans', Arial, sans-serif;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.3s ease;
  text-align: right;
}

.reg-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

[data-theme="dark"] .reg-input:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.reg-input::placeholder {
  color: var(--text-tertiary);
}

/* ==================== Register Button ==================== */
#registerBtn {
  width: 90%;
  padding: 14px;
  margin-top: 15px;
  background: var(--accent-gradient);
  border: none;
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  font-family: 'IRANSans', Arial, sans-serif;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

#registerBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#registerBtn:active {
  transform: translateY(0);
}

/* ==================== Captcha ==================== */
.captcha-container {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
}

.captcha-text {
  font-style: italic;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
}

/* ==================== Responsive Design ==================== */

/* Large Desktop */
@media (min-width: 1200px) {
  .content-box {
    width: 400px;
    padding: 70px 35px 35px 35px;
  }
  
  .box-logo {
    width: 90px;
    height: 90px;
    top: -45px;
  }
}

/* Tablet (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .wrapper {
    gap: 25px;
  }
  
  .content-box {
    width: 350px;
  }
  
  @keyframes slideRight {
    from { opacity: 0; transform: translateX(0); }
    to { opacity: 1; transform: translateX(200px); }
  }
}

/* Small Tablet (481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .wrapper {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  
  .content-box {
    width: 85%;
    max-width: 380px;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.2s;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .content-box h2 {
    font-size: 22px;
  }
  
  .reg-input {
    width: 92%;
  }
  
  .captcha-container {
    flex-direction: column;
    gap: 8px;
  }
  
  .captcha-container .reg-input {
    width: 92% !important;
  }
  
  .theme-toggle-text {
    display: none;
  }
}

/* Mobile (320px to 480px) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  
  .wrapper {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    align-items: center;
  }
  
  .content-box {
    width: 95%;
    max-width: 340px;
    animation: fadeIn 0.6s ease-out forwards;
    animation-delay: 0.1s;
    padding: 50px 18px 20px 18px;
    margin: 8px 0;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }
  
  .content-box h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .content-box p {
    font-size: 13px;
  }
  
  .content-box button {
    width: 95%;
    padding: 12px;
    font-size: 14px;
    min-height: 44px; /* Touch-friendly */
    margin: 10px auto;
  }
  
  .box-logo {
    width: 70px;
    height: 70px;
    top: -35px;
  }
  
  .music-card {
    width: 95%;
    padding: 10px;
    min-height: 70px; /* Touch-friendly */
  }
  
  .music-card img {
    width: 50px;
    height: 50px;
    margin-left: 10px;
  }
  
  .music-info div:first-child {
    font-size: 14px;
  }
  
  .music-info div:last-child {
    font-size: 12px;
  }
  
  .reg-input {
    width: 95%;
    padding: 12px;
    font-size: 14px;
    margin: 8px 0;
  }
  
  #registerBtn {
    width: 95%;
    padding: 12px;
    font-size: 15px;
    min-height: 44px; /* Touch-friendly */
    margin-top: 12px;
  }
  
  .captcha-container {
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
  }
  
  .captcha-text {
    padding: 10px 18px;
    font-size: 15px;
  }
  
  .captcha-container .reg-input {
    width: 95% !important;
  }
  
  .theme-toggle {
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    min-height: 44px; /* Touch-friendly */
  }
  
  .theme-toggle-text {
    display: none;
  }
  
  .theme-toggle-icon {
    font-size: 22px;
  }
}

/* Extra Small Mobile */
@media (max-width: 359px) {
  .content-box {
    width: 98%;
    padding: 45px 15px 18px 15px;
  }
  
  .content-box h2 {
    font-size: 18px;
  }
  
  .content-box button {
    font-size: 13px;
    padding: 10px;
  }
  
  .music-card img {
    width: 45px;
    height: 45px;
  }
  
  .reg-input {
    font-size: 13px;
    padding: 10px;
  }
  
  .captcha-text {
    font-size: 14px;
    padding: 8px 15px;
  }
  
  .box-logo {
    width: 60px;
    height: 60px;
    top: -30px;
  }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .wrapper {
    flex-direction: row;
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
  }
  
  .content-box {
    width: 48%;
    max-width: 320px;
    padding: 35px 15px 15px 15px;
    margin: 0;
    animation: none;
    opacity: 1;
  }
  
  .box-logo {
    width: 50px;
    height: 50px;
    top: -25px;
  }
  
  .content-box h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .content-box button,
  #registerBtn {
    padding: 7px;
    font-size: 12px;
    margin: 5px auto;
  }
  
  .music-card {
    padding: 6px;
    margin-top: 8px;
  }
  
  .music-card img {
    width: 40px;
    height: 40px;
  }
  
  .reg-input {
    padding: 7px;
    margin: 4px 0;
    font-size: 12px;
  }
  
  .captcha-container {
    gap: 6px;
    margin: 8px 0;
  }
  
  .captcha-text {
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .content-box button,
  #registerBtn {
    min-height: 48px;
  }
  
  .music-card {
    min-height: 75px;
  }
  
  .reg-input {
    min-height: 44px;
  }
  
  .theme-toggle {
    min-height: 48px;
    min-width: 48px;
  }
  
  .captcha-text {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}