/* ============================================
   Modern Colorful Portfolio Theme
   ============================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --accent-2: #8b5cf6;
  --pink: #ec4899;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 20px 40px -12px rgb(99 102 241 / 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #ecfeff 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="ltr"] body { direction: ltr; text-align: left; }

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

img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo i {
  color: var(--primary);
}

.logo span {
  font-weight: 400;
  color: #334155;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9rem;
}

.nav a:hover {
  background: #eef2ff;
  color: var(--primary);
}

.nav a.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

.lang-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.lang-btn:hover {
  background: var(--primary);
  color: white;
}

a.lang-btn { text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: #dc2626; }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* Sections */
.section {
  padding: 70px 0;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--secondary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  inset-inline-start: 0;
  width: 48px;
  height: 4px;
  background: var(--gradient);
  border-radius: 4px;
}

.section-subtitle {
  color: var(--text-light);
  margin-bottom: 40px;
  margin-top: 16px;
  font-size: 1.05rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: #c7d2fe;
}

/* Footer */
.footer {
  background: var(--secondary);
  color: #94a3b8;
  padding: 36px 0;
  text-align: center;
  font-size: 0.95rem;
}

.footer a { color: #cbd5e1; }
.footer a:hover { color: white; }

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e7ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.4;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    left: 0;
    background: white;
    flex-direction: column;
    padding: 15px;
    box-shadow: var(--shadow-lg);
  }

  .nav.open { display: flex; }
  .nav a { width: 100%; text-align: center; }
  .section { padding: 45px 0; }
  .section-title { font-size: 1.5rem; }
}
