:root {
  --primary-color: #0071e3;
  --primary-gradient: linear-gradient(135deg, #0071e3, #47a4ff);
  --background-color: #fbfbfd;
  --text-color: #1d1d1f;
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #f5f5f7 0%, #fbfbfd 100%);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  direction: rtl;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px;
  animation: fadeIn 0.6s ease-out;
}

.form-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 48px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.form-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.input-group {
  margin-bottom: 32px;
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
  transition: var(--transition);
}

.input-group input {
  width: 90%;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.input-group input[type="file"] {
  padding: 12px;
  background: #f5f5f7;
  cursor: pointer;
}

.btn {
  background: var(--primary-gradient);
  color: white;
  padding: 16px 32px;
  border-radius: var(--border-radius);
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 113, 227, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 16px;
  transition: var(--transition);
}

.btn-link:hover {
  color: #004c99;
}

.language-switch {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 1000;
}

.language-switch a {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid rgba(0, 113, 227, 0.1);
}

.language-switch a:hover {
  background: var(--primary-color);
  color: white;
}

[dir="ltr"] .language-switch {
  right: 24px;
  left: auto;
}

/* Organization Profile Styles */
.org-profile {
  text-align: center;
}

.org-logo {
  width: 200px;
  height: auto;
  object-fit: cover;
  margin: 0 auto 24px;
}

.org-details {
  margin-top: 32px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(0, 113, 227, 0.05);
  border-radius: var(--border-radius);
  margin-bottom: 12px;
}

.detail-item .label {
  font-weight: 600;
  color: var(--text-color);
}

.detail-item .value {
  color: var(--primary-color);
}

/* Error States */
.input-error {
  border-color: #ff3b30 !important;
  background: rgba(255, 51, 48, 0.05);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.error-message {
  color: #ff3b30;
  font-size: 0.9rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease-out;
}

/* Success States */
.success-message {
  background: #34c759;
  color: white;
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

/* Drag and Drop Styles */
.drag-area {
  padding: 30px;
  border: 2px dashed #e0e0e0;
  border-radius: var(--border-radius);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  position: relative;
}

.drag-area.active {
  border-color: var(--primary-color);
  background: rgba(0, 113, 227, 0.05);
}

.drag-area .icon {
  font-size: 50px;
  color: var(--primary-color);
}

.drag-area img {
  width: 100%;
  max-width: 150px;
  height: auto;
  margin: 10px 0;
  border-radius: 8px;
  display: none;
}

.drag-area .file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.drag-error {
  border-color: #ff3b30 !important;
  background: rgba(255, 51, 48, 0.05);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Company Logo */
.company-logo {
  width: 140px;
  height: auto;
  margin: 0 auto 40px;
  display: block;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.loading-card {
  background: white;
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(20px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.loading-card .number {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.loading-card .text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Loading Cards */
.loading-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.loading-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateX(-50px);
  opacity: 0;
  text-align: center;
  font-weight: 500;
  color: var(--text-color);
  font-size: 1.1rem;
}

/* 404 Error Page */
.error-page {
  text-align: center;
  padding: 60px 40px;
}

.error-page h1 {
  font-size: 6rem;
  margin-bottom: 1rem;
}

.error-message-large {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  line-height: 1.4;
}

.error-page .btn {
  max-width: 300px;
  margin: 0 auto;
}

@keyframes cardSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}

/* Card Designer Styles */
.card-designer {
  margin-top: 40px;
  text-align: center;
}

.orientation-selector {
  margin-bottom: 24px;
}

.btn-orientation {
  background: white;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 12px 24px;
  border-radius: var(--border-radius);
  margin: 0 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-orientation.active {
  background: var(--primary-gradient);
  color: white;
}

.card-preview {
  position: relative;
  margin: 20px auto;
  max-width: 800px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-canvas {
  position: relative;
  width: 100%;
  padding-bottom: 177.77%; /* 9:16 ratio */
  background: #000;
  overflow: hidden;
}

.card-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.card-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 45%;
  z-index: 2;
}

.card-org-logo {
  width: min(45%, 250px);
  height: auto;
  object-fit: contain;
}

.card-org-name {
  display: none;
  margin-top: 20px; /* Add space between logo and name */
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #4d2980;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  width: 100%;
  text-align: center;
}

.card-visitor-name {
  position: absolute;
  bottom: 35%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1.2rem, 3vw, 3rem);
  font-weight: 600;
  color: #4d2980;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  width: 100%;
  text-align: center;
}

.card-controls {
  margin-top: 24px;
}

.visitor-name-input {
  max-width: 300px;
  margin: 0 auto;
}

/* Logos Container */
.logos-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
}

/* Admin Styles */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--primary-gradient);
  padding: 24px;
  border-radius: var(--border-radius);
  color: white;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 10px 0;
}

.recent-orgs table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.recent-orgs th,
.recent-orgs td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.recent-orgs th {
  font-weight: 600;
  background: #f5f5f7;
}

.resend-form {
  margin-top: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .form-container {
    padding: 32px;
  }

  h1 {
    font-size: 2rem;
  }
}
