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

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  direction: rtl;
}

.container {
  background: white;
  border-radius: 20px;
  padding: 50px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 700px;
  text-align: center;
}

.school-name {
  font-size: 44px;
  font-weight: bold;
  color: #764ba2;
  margin-bottom: 5px;
}

h1 {
  color: #333;
  font-size: 28px;
  margin-bottom: 10px;
}

.subtitle {
  color: #666;
  font-size: 18px;
  margin-bottom: 30px;
}

.search-box {
  width: 100%;
  padding: 20px 25px;
  font-size: 24px;
  border: 3px solid #e0e0e0;
  border-radius: 15px;
  outline: none;
  transition: border-color 0.3s;
  text-align: center;
  letter-spacing: 2px;
}

.search-box:focus {
  border-color: #667eea;
}

.btn {
  display: inline-block;
  padding: 18px 50px;
  font-size: 22px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
  margin-top: 20px;
  min-width: 250px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

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

.admin-link {
  display: inline-block;
  margin-top: 40px;
  color: #999;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.admin-link:hover {
  color: #667eea;
}

.visitor-count {
  margin-top: 5px;
  color: #aaa;
  font-size: 12px;
  text-align: center;
}

.error-msg {
  color: #e74c3c;
  margin-top: 15px;
  font-size: 16px;
  display: none;
}

.success-msg {
  color: #27ae60;
  margin-top: 15px;
  font-size: 16px;
  display: none;
}

.pdf-container {
  margin-top: 30px;
  display: none;
  text-align: center;
}

.certificate-wrapper {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  padding: 10px;
  text-align: center;
}

.certificate-wrapper canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.action-buttons {
  display: none;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  min-width: auto;
  padding: 12px 25px;
  font-size: 16px;
  flex: 1;
  max-width: 200px;
}

.btn-download {
  background: #27ae60;
  color: white;
}

.btn-download:hover {
  background: #219a52;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(39, 174, 96, 0.4);
}

.btn-image {
  background: #2980b9;
  color: white;
}

.btn-image:hover {
  background: #2472a4;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(41, 128, 185, 0.4);
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.overlay img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

.loading {
  display: none;
  margin: 20px 0;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-form {
  max-width: 400px;
  margin: 0 auto;
}

.login-form input {
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 18px;
  text-align: center;
}

.login-form input:focus {
  border-color: #667eea;
  outline: none;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.file-upload-area {
  border: 3px dashed #ccc;
  border-radius: 15px;
  padding: 40px;
  margin: 20px 0;
  cursor: pointer;
  transition: all 0.3s;
}

.file-upload-area:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.file-upload-area input[type="file"] {
  display: none;
}

.file-upload-label {
  font-size: 18px;
  color: #666;
  cursor: pointer;
}

.file-upload-label strong {
  color: #667eea;
}

.upload-status {
  margin-top: 15px;
  padding: 15px;
  border-radius: 10px;
  display: none;
}

.upload-status.success {
  display: block;
  background: #d4edda;
  color: #155724;
}

.upload-status.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.news-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 1px solid #8fd19e;
  border-radius: 12px;
  padding: 10px 15px;
  margin: 10px 0 20px;
  overflow: hidden;
}

.banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.banner-text-wrap {
  overflow: hidden;
  flex: 1;
}

.banner-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 25px;
  color: #155724;
  animation: scrollBanner 20s linear infinite;
}

@keyframes scrollBanner {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
    width: 95%;
  }
  .search-box {
    font-size: 18px;
    padding: 15px;
  }
  .btn {
    font-size: 18px;
    padding: 14px 30px;
    min-width: auto;
    width: 100%;
  }
  .school-name {
    font-size: 28px;
  }
  h1 {
    font-size: 22px;
  }
  .action-buttons .btn {
    max-width: none;
  }
  .certificate-wrapper iframe {
    height: 60vh !important;
  }
}
