/* ============================================
   SUPPLIER PORTAL - Styles
   Inspired by Hensslers Schnelle Nummer Shop
   China-compatible: No Google Fonts, system fonts only
   ============================================ */

:root {
  --primary: #c41e3a;
  --primary-dark: #a01830;
  --primary-light: #e8324f;
  --secondary: #1a1a2e;
  --accent: #f5a623;
  --bg: #f8f8f8;
  --bg-white: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
  background: var(--bg-white);
  border-bottom: 3px solid var(--primary);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
}

.navbar-brand img {
  height: 40px;
}

.navbar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--primary);
  color: white;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user .user-name {
  font-size: 0.85rem;
  color: var(--text-light);
}

.btn-logout {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .navbar-nav.open { display: flex; }
  .navbar { padding: 0 1rem; }
}

/* ============================================
   LANDING / LOGIN PAGE
   ============================================ */
.landing-hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #16213e 100%);
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: var(--primary);
  opacity: 0.08;
  border-radius: 50%;
}

.landing-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem;
  max-width: 1000px;
  width: 100%;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.landing-info {
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-info h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.landing-info h1 span {
  color: var(--primary-light);
}

.landing-info p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-features .feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
}

.landing-features .feature-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .landing-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .landing-info h1 { font-size: 1.8rem; }
}

/* ============================================
   CARDS / PANELS
   ============================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 2rem 0;
}

.card-header h2 {
  font-size: 1.4rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-body {
  padding: 1.5rem 2rem 2rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.form-group label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-row-3 { grid-template-columns: 1fr; }
}

.form-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.form-section h3 {
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section h3 .section-icon {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
}

/* Checkbox / Guidelines */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 1rem;
  background: #fef9f0;
  border: 1px solid #f0d9a8;
  border-radius: var(--radius);
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.checkbox-group label {
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: #fff5f7;
}

.file-upload-area .upload-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-upload-area p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #2a2a4e;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* ============================================
   MAIN LAYOUT (Dashboard)
   ============================================ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--secondary);
}

.page-header p {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================
   TABS (Dashboard Navigation)
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   TENDER CARDS
   ============================================ */
.tender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.tender-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.tender-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tender-card-image {
  width: 100%;
  height: 200px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tender-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tender-card-image .placeholder-icon {
  font-size: 3rem;
  color: var(--text-muted);
}

.tender-card-body {
  padding: 1.25rem;
}

.tender-card-body .q-number {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tender-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.tender-card-body p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.tender-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tender-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 1.25rem 1.25rem;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-active { background: #e8f5e9; color: var(--success); }
.badge-pending { background: #fff8e1; color: var(--warning); }
.badge-closed { background: #ffebee; color: var(--danger); }
.badge-draft { background: #f5f5f5; color: var(--text-muted); }

/* ============================================
   TABLES (Admin)
   ============================================ */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}

tr:hover td {
  background: #fafafa;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.2rem;
  color: var(--secondary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================
   ALERTS / NOTIFICATIONS
   ============================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-info { background: #e3f2fd; color: #1565c0; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-warning { background: #fff8e1; color: #f57f17; }
.alert-danger { background: #ffebee; color: #c62828; }

/* Pending approval banner */
.pending-banner {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid #f0d9a8;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 2rem auto;
  max-width: 600px;
}

.pending-banner h2 {
  color: var(--warning);
  margin-bottom: 0.5rem;
}

/* ============================================
   GUIDELINES DISPLAY
   ============================================ */
.guidelines-content {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

.guidelines-content h2 {
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
  font-size: 1.2rem;
}

.guidelines-content h3 {
  color: var(--secondary);
  margin: 1rem 0 0.5rem;
  font-size: 1.05rem;
}

.guidelines-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.guidelines-content li {
  margin-bottom: 0.5rem;
}

/* ============================================
   ABOUT US SECTION
   ============================================ */
.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .about-section { grid-template-columns: 1fr; }
}

.about-section .about-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

.about-section .about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.6);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 4rem;
}

.footer a {
  color: rgba(255,255,255,0.8);
}

.footer .impressum-link {
  cursor: pointer;
  text-decoration: underline;
}

/* ============================================
   DOWNLOAD ITEMS
   ============================================ */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  transition: var(--transition);
}

.download-item:hover {
  background: #f0f0f0;
}

.download-item .file-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.file-icon.xlsx { background: #217346; }
.file-icon.pdf { background: #d32f2f; }
.file-icon.img { background: #1976d2; }
.file-icon.zip { background: #795548; }

.download-item .file-info {
  flex: 1;
}

.download-item .file-info .file-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.download-item .file-info .file-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay.active {
  display: flex;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--secondary);
  color: white;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   IMPRESSUM MODAL
   ============================================ */
.impressum-content {
  font-size: 0.9rem;
  line-height: 1.8;
}

.impressum-content h4 {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: var(--secondary);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.d-flex { display: flex; }
.d-none { display: none; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* Admin specific */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

.admin-stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.admin-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Quick action buttons for admin email */
.quick-actions {
  display: flex;
  gap: 6px;
}

.quick-actions .btn {
  padding: 4px 10px;
  font-size: 0.8rem;
}
