/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Icon Styles */
.btn-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.btn-icon-sm {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

.status-icon {
  width: 80px;
  height: 80px;
}

.info-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.header-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  vertical-align: middle;
  margin-right: 8px;
}

.badge-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

.label-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.8;
}

.icon-spin {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.sif-search-app {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: 80vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.header-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 15px;
  border-radius: 50%;
  background: white;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Language Selector */
.language-selector {
  background: #f8f9fa;
  padding: 15px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.language-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.language-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.language-btn {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 5px;
}

.language-btn:hover {
  border-color: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(76, 175, 80, 0.2);
}

.language-btn.active {
  background: #4caf50;
  border-color: #4caf50;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

/* RTL Support for Arabic */
body.rtl {
  direction: rtl;
}

body.rtl .search-buttons {
  left: 10px;
  right: auto;
}

body.rtl .search-input {
  padding: 18px 20px 18px 120px;
}

body.rtl .language-options {
  flex-direction: row-reverse;
}

body.rtl .help-list {
  text-align: right;
}

body.rtl .code-examples,
body.rtl .search-tips {
  flex-direction: row-reverse;
}

body.rtl .results-header {
  flex-direction: row-reverse;
}

/* Search Container */
.search-container {
  padding: 30px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 18px 120px 18px 20px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 50px;
  outline: none;
  transition: all 0.3s ease;
  background: white;
}

.search-input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-buttons {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 5px;
}

.clear-button,
.search-button {
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-button {
  background: #4caf50;
}

.search-button:hover {
  background: #45a049;
  transform: scale(1.1);
}

.clear-button:hover {
  background: #ff5252;
  transform: scale(1.1);
}

.loading {
  text-align: center;
  margin-top: 20px;
  font-size: 1.1rem;
  color: #666;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Results Container */
.results-container {
  padding: 30px;
  min-height: 400px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.results-header h3 {
  color: #333;
  font-size: 1.3rem;
}

.results-count {
  background: #4caf50;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Results List */
.results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.code-badge {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
}

/* Halal Result Status */
.halal-result {
  text-align: center;
  padding: 40px 30px;
  border-radius: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.halal-result.is-halal {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 3px solid #28a745;
}

.halal-result.not-halal {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 3px solid #dc3545;
}

.halal-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.halal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.halal-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.is-halal .halal-title {
  color: #155724;
}

.not-halal .halal-title {
  color: #721c24;
}

.halal-message {
  font-size: 1.1rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.is-halal .halal-message {
  color: #155724;
}

.not-halal .halal-message {
  color: #721c24;
}

.search-term {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 20px;
}

.search-term strong {
  color: #333;
}

.found-codes {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid rgba(40, 167, 69, 0.3);
}

.found-codes-title {
  font-size: 1rem;
  font-weight: 600;
  color: #155724;
  margin-bottom: 15px;
}

/* Help Section */
.help-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid rgba(220, 53, 69, 0.3);
}

.help-text {
  font-weight: 600;
  margin-bottom: 15px !important;
  color: #721c24;
}

.help-list {
  text-align: left;
  display: inline-block;
  color: #6c757d;
  margin-bottom: 0;
}

.help-list li {
  margin: 8px 0;
  padding-left: 5px;
}

/* No Results (legacy) */
.no-results {
  text-align: center;
  padding: 40px 20px;
  background: #fff3cd;
  border-radius: 15px;
  border: 1px solid #ffeaa7;
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #856404;
}

/* Welcome Message */
.welcome-message {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.welcome-message p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.example-codes p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #495057;
}

.code-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.example-code {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.example-code:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

/* More Examples Section */
.more-examples {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.more-examples p {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #495057;
}

.search-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tip-code {
  background: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.tip-code:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(253, 121, 168, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .language-selector {
    padding: 12px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .language-options {
    justify-content: center;
  }

  .language-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .search-container {
    padding: 20px;
  }

  .search-input {
    padding: 15px 100px 15px 15px;
    font-size: 1rem;
  }

  body.rtl .search-input {
    padding: 15px 15px 15px 100px;
  }

  .search-buttons {
    right: 8px;
  }

  body.rtl .search-buttons {
    left: 8px;
    right: auto;
  }

  .clear-button,
  .search-button {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .results-container {
    padding: 20px;
  }

  .results-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  body.rtl .results-header {
    flex-direction: column;
  }

  .results-list {
    grid-template-columns: 1fr;
  }

  .code-examples {
    flex-direction: column;
    align-items: center;
  }

  .example-code {
    width: 200px;
  }

  .search-tips {
    flex-direction: column;
    align-items: center;
  }

  .tip-code {
    width: 180px;
    text-align: center;
  }

  /* Halal Result Responsive */
  .halal-result {
    padding: 30px 20px;
  }

  .status-icon {
    width: 60px;
    height: 60px;
  }

  .halal-title {
    font-size: 1.5rem;
  }

  .halal-message {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .header {
    padding: 30px 20px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .language-selector {
    padding: 10px 15px;
  }

  .language-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .search-container,
  .results-container {
    padding: 15px;
  }
}

/* Click hint */
.click-hint {
  font-size: 0.9rem;
  color: #155724;
  margin-bottom: 15px;
  opacity: 0.8;
}

/* Result item with click */
.result-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.click-icon {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: #ff5252;
  transform: scale(1.1);
}

.modal-header {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 25px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.halal-badge {
  background: white;
  color: #4caf50;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
}

.company-info-list {
  padding: 20px;
}

.company-card {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid #4caf50;
}

.company-card:last-child {
  margin-bottom: 0;
}

.info-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.info-value {
  color: #333;
  font-size: 1rem;
  line-height: 1.4;
}

.recognition-text {
  font-size: 0.85rem;
  white-space: pre-line;
  background: #e9ecef;
  padding: 10px;
  border-radius: 8px;
  margin-top: 5px;
}

/* RTL Support for Modal */
body.rtl .modal-close {
  right: auto;
  left: 15px;
}

body.rtl .company-card {
  border-left: none;
  border-right: 4px solid #4caf50;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    max-height: 90vh;
    border-radius: 15px;
  }

  .modal-header {
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .company-info-list {
    padding: 15px;
  }

  .company-card {
    padding: 15px;
  }
}

/* Footer Styles */
.app-footer {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  padding: 20px 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  color: #4caf50;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: #f8f9fa;
}

.share-button:active {
  transform: translateY(0);
}

.share-icon {
  width: 20px;
  height: 20px;
}

/* QR Code Modal Styles */
.qr-modal-content {
  background: white;
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

.qr-modal-header {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 30px 20px;
  text-align: center;
  border-radius: 20px 20px 0 0;
}

.qr-modal-header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.qr-modal-header p {
  font-size: 0.95rem;
  opacity: 0.9;
}

.qr-code-container {
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
}

.qr-code-image {
  max-width: 250px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive Footer */
@media (max-width: 768px) {
  .app-footer {
    padding: 15px 20px;
  }

  .share-button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .qr-modal-content {
    max-width: 350px;
  }

  .qr-code-image {
    max-width: 200px;
  }
}
