/* Persian RTL Landing Page Styles */

/* Import local Persian font */
@font-face {
  font-family: 'YekanBakh';
  src: url('../static/fonts/YekanBakhRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'YekanBakh', 'Tahoma', 'Arial', sans-serif;
  direction: rtl;
  text-align: right;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  min-height: 100vh;
  color: #1565c0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(25, 118, 210, 0.2);
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.1);
}

.logo-container {
  margin-bottom: 15px;
}

.logo {
  max-width: 150px;
  height: auto;
  /* Removed filter to show original blue color */
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* Responsive logo sizing */
@media (max-width: 768px) {
  .logo {
    max-width: 120px;
  }
}

@media (max-width: 480px) {
  .logo {
    max-width: 100px;
  }
}

@media (min-width: 1200px) {
  .logo {
    max-width: 180px;
  }
}

.header h1 {
  font-size: 3rem;
  color: #0d47a1;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-weight: 700;
  letter-spacing: -1px;
}

.header p {
  font-size: 1.4rem;
  color: #1976d2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* Search */
.search-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  outline: none;
  transition: all 0.3s ease;
  font-family: 'YekanBakh', 'Tahoma', 'Arial', sans-serif;
  direction: rtl;
}

.search-input:focus {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #666;
  pointer-events: none;
}

/* Apps grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 30px 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid rgba(25, 118, 210, 0.2);
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.1);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-section {
  display: flex;
  align-items: center;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.contact-icon {
  font-size: 1.1rem;
}

.contact-label {
  color: #0d47a1;
  font-weight: 600;
}

.contact-link {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: #0d47a1;
  text-decoration: underline;
}

.footer-text p {
  color: #0d47a1;
  font-size: 0.9rem;
  margin: 0;
  margin-right: 20px !important;
  font-weight: 500;
}

.footer-enamad {
  display: flex;
  align-items: center;
}

.enamad-link {
  transition: transform 0.3s ease;
  display: inline-block;
}

.enamad-link:hover {
  transform: scale(1.05);
}

.enamad-logo {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* App card */
.app-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  min-height: 450px;
  display: flex;
  flex-direction: column;
}

.app-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2), 0 10px 25px rgba(0,0,0,0.15);
}

.app-card-image {
  width: 120px;
  height: 120px;
  margin: 20px auto 15px;
  border-radius: 15px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.app-card:hover .app-card-image {
  transform: scale(1.05);
}

.app-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.app-card-image img.loaded {
  opacity: 1;
}

.app-card-image img:not(.loaded) {
  opacity: 0;
}

/* Lazy loading states */
.app-card-image img.lazy-loading {
  opacity: 0.7;
  filter: blur(1px);
  transform: scale(1.02);
}

.app-card-image img.loaded {
  opacity: 1;
  filter: none;
  transform: scale(1);
}

.app-card-content {
  padding: 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.app-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.app-version {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.app-install-count {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #28a745;
  font-weight: 500;
  margin-bottom: 10px;
  gap: 5px;
}

.install-icon {
  font-size: 1rem;
}

.app-price {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #28a745;
  font-weight: 600;
  margin-bottom: 20px;
  gap: 5px;
  background: rgba(40, 167, 69, 0.1);
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.price-icon {
  font-size: 1.1rem;
}

.app-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 15px;
}

.app-buttons .btn-activation {
  grid-column: span 3;
  margin-top: 8px;
}

.btn {
  padding: 12px 15px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

/* Store icon images */
.store-icon {
  width: 100%;
  height: auto;
  margin-left: 5px;
  vertical-align: middle;
  max-height: 44px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.btn:hover .store-icon {
  transform: scale(1.05);
}

.btn-primary {
  background: #42a5f5;
  color: white;
}

.btn-primary:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

.btn-success {
  background: #42a5f5;
  color: white;
}

.btn-success:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

.btn-cafe {
  background: #42a5f5;
  color: white;
}

.btn-cafe:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

.btn-myket {
  background: #42a5f5;
  color: white;
}

.btn-myket:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}

/* Form styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e1e1;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'YekanBakh', 'Tahoma', 'Arial', sans-serif;
  direction: ltr;
  text-align: left;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #1964ff;
  box-shadow: 0 0 0 3px rgba(25, 100, 255, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #dc3545;
}

.form-group input:valid:not(:placeholder-shown),
.form-group input.valid {
  border-color: #28a745 !important;
  background-color: rgba(40, 167, 69, 0.05);
}

.form-group input.invalid {
  border-color: #dc3545 !important;
  background-color: rgba(220, 53, 69, 0.05);
}

.form-help {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

.form-help strong {
  color: #1964ff;
}

.support-link {
  color: #1964ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.support-link:hover {
  color: #0d47a1;
  text-decoration: underline;
}

.warning-message {
  display: block;
  margin-top: 10px;
  padding: 10px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 1px solid #f39c12;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #8b4513;
  line-height: 1.5;
  text-align: right;
  direction: rtl;
}

.telegram-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.telegram-template {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: right;
  direction: rtl;
}

.telegram-template code {
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  font-family: 'YekanBakh', monospace;
  font-size: 0.85rem;
  display: block;
  margin-top: 8px;
  color: #495057;
  white-space: pre-line;
}

.btn-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.btn-telegram:hover {
  background: linear-gradient(135deg, #006699 0%, #004466 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.btn-telegram span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 8px;
  transition: background 0.3s ease;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Payment Status Modals */
.error-dialog {
  border-left: 4px solid #dc3545;
}

.error-icon {
  font-size: 3rem;
  color: #dc3545;
  margin-bottom: 15px;
}

.error-dialog h2 {
  color: #dc3545;
  margin-bottom: 15px;
}

.error-details {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: right;
  direction: rtl;
  color: #721c24;
}

.error-help {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: right;
  direction: rtl;
  color: #495057;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 550px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
}

.close {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #333;
}

.modal h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Vazirmatn', sans-serif;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #1964ff;
}

.btn-submit {
  width: 100%;
  background: #42a5f5;
  color: white;
  font-size: 1rem;
  font-family: 'YekanBakh', 'Tahoma', 'Arial', sans-serif;
  font-weight: 500;
  padding: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.btn-submit:hover {
  background: #1976d2;
  transform: translateY(-2px);
}

/* Success dialog */
.success-dialog {
  background: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
}

.success-dialog h2 {
  color: #28a745;
  margin-bottom: 15px;
}

.success-dialog p {
  color: #666;
  margin-bottom: 25px;
}

.success-icon {
  font-size: 4rem;
  color: #28a745;
  margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1964ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  /* Mobile app card image optimization */
  .app-card-image {
    width: 100px;
    height: 100px;
    margin: 15px auto 12px;
    border-radius: 12px;
  }

  .app-card {
    min-height: 400px;
  }

  .app-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .app-buttons .btn-activation {
    grid-column: span 1;
    font-family: 'Vazirmatn' !important;
  }

  .btn {
    width: 100%;
    font-family: 'Vazirmatn' !important;
  }

  /* Mobile store icon optimization */
  .store-icon {
    max-height: 40px;
    margin-left: 3px;
    width: 100%;
  }

  /* Mobile footer optimization */
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .footer-section {
    display: block;
  }

  .footer-text p {
    margin-right: 0 !important;
    margin-bottom: 10px;
  }

  .footer-enamad {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .app-card-image {
    width: 90px;
    height: 90px;
    margin: 12px auto 10px;
    border-radius: 10px;
  }

  .app-card {
    min-height: 380px;
  }

  .apps-grid {
    gap: 15px;
  }

  .container {
    padding: 15px;
  }

  .header {
    padding: 15px 15px;
    margin-bottom: 20px;
  }

  .header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .header p {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
}

@media (max-width: 360px) {
  /* Very small screens */
  .app-card-image {
    width: 80px;
    height: 80px;
    margin: 10px auto 8px;
    border-radius: 8px;
  }

  .app-card {
    min-height: 360px;
  }

  .header h1 {
    font-size: 1.6rem;
  }

  .header p {
    font-size: 1.1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Tablet screens */
  .apps-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
  }

  .app-card-image {
    width: 110px;
    height: 110px;
    margin: 18px auto 15px;
    border-radius: 14px;
  }

  .app-card {
    min-height: 430px;
  }
}

@media (min-width: 1025px) and (max-width: 1199px) {
  /* Small desktop screens */
  .apps-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
  }

  .app-card-image {
    width: 130px;
    height: 130px;
    margin: 22px auto 16px;
    border-radius: 16px;
  }

  .app-card {
    min-height: 460px;
  }
}

@media (min-width: 1200px) {
  /* Large desktop screens */
  .app-card-image {
    width: 140px;
    height: 140px;
    margin: 25px auto 18px;
    border-radius: 18px;
  }

  .app-card {
    min-height: 480px;
  }
}

@media (min-width: 1440px) {
  /* Extra large screens */
  .container {
    max-width: 1400px;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
  }

  .app-card-image {
    width: 150px;
    height: 150px;
    margin: 28px auto 20px;
    border-radius: 20px;
  }

  .app-card {
    min-height: 500px;
  }
}