/* Beruwang Saudi Arabia - Main Styles */
:root {
  /* Saudi Colors */
  --primary-color: #006C35; /* Green from Saudi flag */
  --secondary-color: #000000; /* Black from Saudi flag */
  --accent-color: #FFD700; /* Gold accent */
  --text-color: #333333;
  --text-color-ar: #444444;
  --bg-color: #ffffff;
  --card-bg: #f8f9fa;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Language-specific fonts */
.en {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ar {
  font-family: 'Tahoma', 'Arial', sans-serif;
  direction: rtl;
  text-align: right;
}

/* Header styles */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--accent-color);
}

.language-switcher {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.language-switcher:hover {
  background: rgba(255,255,255,0.3);
}

/* Main content */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary-color);
  text-align: center;
}

/* Search section */
.search-section {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .search-form {
    grid-template-columns: 1fr 1fr 1fr auto;
  }
}

.search-input,
.search-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
}

.search-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.search-button:hover {
  background: #00562a;
}

/* Tender list */
.tender-list {
  display: grid;
  gap: 1rem;
}

.tender-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tender-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tender-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.tender-id {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 15px;
  font-size: 0.875rem;
  font-weight: bold;
}

.tender-deadline {
  color: var(--danger-color);
  font-weight: bold;
}

.tender-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.tender-description {
  color: var(--text-color);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.tender-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-icon {
  color: var(--primary-color);
}

.tender-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.action-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.view-details {
  background: var(--info-color);
  color: white;
}

.view-details:hover {
  background: #138496;
}

.download-docs {
  background: var(--success-color);
  color: white;
}

.download-docs:hover {
  background: #218838;
}

/* Responsive design */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .search-form {
    grid-template-columns: 1fr;
  }
  
  .tender-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .tender-actions {
    flex-direction: column;
  }
}

/* RTL specific styles */
.ar .tender-header {
  flex-direction: row-reverse;
}

.ar .meta-item {
  flex-direction: row-reverse;
}

.ar .action-button {
  text-align: center;
}

/* Loading and error states */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--primary-color);
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 5px;
  margin: 1rem 0;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Footer */
.footer {
  background: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-link {
  color: white;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Etimad specific styling */
.etimad-badge {
  background: linear-gradient(135deg, #006C35, #004d28);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 0.5rem;
}

.ar .etimad-badge {
  margin-right: 0.5rem;
  margin-left: 0;
}

/* Saudi government compliance */
.compliance-note {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}