/* ================================================================
   BalloonAI - Global Styles
   نظام التصميم الشامل لموقع BalloonAI
   ================================================================ */

/* ================== CSS Variables ================== */
:root {
  /* Colors */
  --bg-dark: #0a0118;
  --bg-darker: #050008;
  --bg-card: #1a0f2e;
  --bg-card-hover: #251540;
  --bg-input: #120824;
  
  /* Accent Colors */
  --accent-primary: #ff4b8b;
  --accent-secondary: #a855f7;
  --accent-tertiary: #3b82f6;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #c4b5fd;
  --text-muted: #94a3b8;
  
  /* Borders */
  --border-subtle: rgba(168, 85, 247, 0.15);
  --border-glow: rgba(255, 75, 139, 0.3);
  
  /* Gradients */
  --gradient-1: linear-gradient(135deg, #ff4b8b 0%, #a855f7 50%, #3b82f6 100%);
  --gradient-2: linear-gradient(135deg, rgba(255, 75, 139, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(255, 75, 139, 0.25);
  --shadow-glow: 0 0 60px rgba(168, 85, 247, 0.4);
  
  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================== Reset & Base ================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Almarai', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-darker);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================== Animated Background ================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 75, 139, 0.15) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
  animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ================== Container ================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ================== Typography ================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-normal);
}

/* ================== Buttons ================== */
.btn {
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  box-shadow: 0 25px 70px rgba(255, 75, 139, 0.35);
  transform: translateY(-3px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border-glow);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ================== Cards ================== */
.card {
  background: rgba(26, 15, 46, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: var(--transition-slow);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

/* ================== Forms ================== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-normal);
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(255, 75, 139, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* ================== Header ================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 1, 24, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  gap: 32px;
}

/* ================== Logo ================== */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: white;
  box-shadow: var(--shadow-glow);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4),
                0 0 40px rgba(255, 75, 139, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.6),
                0 0 80px rgba(255, 75, 139, 0.4);
  }
}

.logo-text h1 {
  font-size: 24px;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}

.logo-text p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ================== Navigation ================== */
nav {
  display: flex;
  gap: 8px;
  background: rgba(26, 15, 46, 0.6);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.nav-link {
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-normal);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(168, 85, 247, 0.1);
}

.nav-link.active {
  background: var(--gradient-1);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

/* ================== Animations ================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out both;
}

/* ================== Utilities ================== */
.text-gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ================== Responsive ================== */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
}

@media (max-width: 968px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 16px;
  }

  nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .logo-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .logo-text h1 {
    font-size: 20px;
  }
}

/* ================== Footer ================== */
footer {
  background: rgba(5, 0, 8, 0.8);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 40px;
  margin-top: 100px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand h3 {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-section h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition-normal);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 968px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  footer {
    padding: 40px 0 30px;
  }
}
/* ================== Header Actions ================== */
.header-actions{
  display:flex;
  gap:12px;
  align-items:center;
}

/* ================== Studio / Dashboard Shared Layout ================== */
.studio-hero{
  padding: 60px 0 40px;
  text-align: center;
  animation: fadeInUp .8s ease-out .2s both;
}

.studio-title{
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color: transparent;
  background-clip:text;
}

.studio-subtitle{
  font-size: 16px;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 32px;
}

.studio-layout{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  margin-bottom: 80px;
}

/* اجعل Panels نفس card لكن باسم studio-panel أيضاً */
.studio-panel{
  background: rgba(26, 15, 46, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  animation: fadeInUp .8s ease-out both;
}

.panel-header{
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title{
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.panel-description{
  font-size: 14px;
  color: var(--text-muted);
}

/* ================== Primary CTA Button (used in Studio/Dashboard) ================== */
.generate-btn{
  width:100%;
  padding: 18px;
  background: var(--gradient-1);
  border:none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  color:#fff;
  cursor:pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-lg);
  display:inline-block;
  text-align:center;
}

.generate-btn:hover{
  transform: translateY(-3px);
  box-shadow: 0 30px 80px rgba(255,75,139,.4);
}

/* ================== Simple Info Card (Credits / Usage) ================== */
.cost-card{
  background: linear-gradient(135deg, rgba(251,191,36,.15) 0%, rgba(251,191,36,.05) 100%);
  border: 1px solid rgba(251,191,36,.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
}

.cost-row{
  display:flex;
  justify-content: space-between;
  align-items:center;
  margin-bottom: 12px;
  font-size: 14px;
}

.cost-row:last-child{
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(251,191,36,.2);
  font-weight: 800;
  font-size: 16px;
  color:#fbbf24;
}

/* ================== Tips List ================== */
.tips-list{
  list-style:none;
  font-size: 14px;
  color: var(--text-secondary);
}

.tips-list li{
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.tips-list li::before{
  content:'•';
  position:absolute;
  left: 0;
  top: 8px;
  color: var(--accent-primary);
}

/* ================== Responsive: Studio Layout ================== */
@media (max-width: 1200px){
  .studio-layout{ grid-template-columns: 1fr; }
  .studio-title{ font-size: 40px; }
}

@media (max-width: 640px){
  .studio-title{ font-size: 32px; }
  .studio-panel{ padding: 24px; }
}

/* ================== Print Styles ================== */
@media print {
  header,
  footer,
  nav,
  .btn,
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}