/* ============================================================================
   SCHWANITZ IMMO - Website Styles
   Responsive Design: Mobile-first + Desktop enhancements
   ============================================================================ */

:root {
  /* Color Palette */
  --c-accent: #1A7DBE;           /* Schwanitz Primary Blue */
  --c-accent-light: #3E9ADB;      /* Lighter Blue */
  --c-accent-dark: #0E4A7E;       /* Darker Blue */
  --c-accent-bg: #E8F4FB;         /* Light Blue Background */

  --c-bg: #F5F7FA;                /* Page Background */
  --c-surface: #FFFFFF;           /* Card/Modal Background */
  --c-surface-light: #F9FAFB;     /* Subtle Background */
  --c-border: #E0E7FF;            /* Border Color */
  --c-border-light: #F0F3FF;      /* Light Border */

  --c-text: #2C3E50;              /* Main Text */
  --c-text-light: #5A6C7D;        /* Secondary Text */
  --c-text-lighter: #8B95A5;      /* Tertiary Text */

  --c-success: #059669;           /* Success */
  --c-success-bg: #ECFDF5;
  --c-warn: #D97706;              /* Warning */
  --c-warn-bg: #FEF3C7;
  --c-error: #DC2626;             /* Error */
  --c-error-bg: #FEE2E2;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;

  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;

  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--c-accent-light);
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-md) var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header__container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--c-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo:hover {
  color: var(--c-accent-light);
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

.nav a {
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
}

.nav a:hover {
  color: var(--c-accent);
  text-decoration: none;
}

.nav a.active {
  color: var(--c-accent);
  border-bottom: 2px solid var(--c-accent);
  padding-bottom: 2px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 24px;
  background: none;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-text);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

/* Mobile Menu */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--c-surface);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--c-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav.active {
    max-height: 300px;
  }

  .nav a {
    width: 100%;
    padding: var(--space-sm) 0;
  }

  .header__container {
    flex-wrap: wrap;
  }
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-dark) 100%);
  color: white;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.hero__content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-tight);
}

.hero p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-lg);
  opacity: 0.95;
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-xl) var(--space-md);
  }

  .hero h1 {
    font-size: var(--font-size-3xl);
  }

  .hero p {
    font-size: var(--font-size-base);
  }
}

/* ============================================================================
   CONTAINER & GRID LAYOUT
   ============================================================================ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
}

.grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

/* ============================================================================
   CARDS & COMPONENTS
   ============================================================================ */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-slow);
}

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

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

.card h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
  color: var(--c-accent);
}

.card p {
  color: var(--c-text-light);
  margin-bottom: var(--space-md);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.btn--primary:hover {
  background: var(--c-accent-light);
}

.btn--secondary {
  background: var(--c-surface-light);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

.btn--secondary:hover {
  background: var(--c-border-light);
}

.btn--outline {
  border: 2px solid var(--c-accent);
  color: var(--c-accent);
  background: transparent;
}

.btn--outline:hover {
  background: var(--c-accent-bg);
}

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

.btn--success:hover {
  background: #047857;
}

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

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

.btn--lg {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
}

.btn--sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

.btn--block {
  width: 100%;
}

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

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--c-text);
}

input, textarea, select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  color: var(--c-text);
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-bg);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

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

.error-text {
  color: var(--c-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.active .modal {
  transform: scale(1);
}

.modal__header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--c-text);
}

.modal__close {
  background: none;
  font-size: var(--font-size-xl);
  color: var(--c-text-light);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal__body {
  padding: var(--space-lg);
}

.modal__footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* ============================================================================
   TABS
   ============================================================================ */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  gap: 0;
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

.tab-btn {
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--c-text-light);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.tab-btn.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

.tab-content {
  display: none;
}

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

@media (max-width: 768px) {
  .tabs {
    gap: var(--space-sm);
  }

  .tab-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }
}

/* ============================================================================
   ALERTS & TOASTS
   ============================================================================ */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.alert--success {
  background: var(--c-success-bg);
  color: var(--c-success);
  border-left: 4px solid var(--c-success);
}

.alert--warning {
  background: var(--c-warn-bg);
  color: var(--c-warn);
  border-left: 4px solid var(--c-warn);
}

.alert--error {
  background: var(--c-error-bg);
  color: var(--c-error);
  border-left: 4px solid var(--c-error);
}

.alert--info {
  background: var(--c-accent-bg);
  color: var(--c-accent);
  border-left: 4px solid var(--c-accent);
}

.toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

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

.toast--success { border-left: 4px solid var(--c-success); }
.toast--error { border-left: 4px solid var(--c-error); }
.toast--warning { border-left: 4px solid var(--c-warn); }
.toast--info { border-left: 4px solid var(--c-accent); }

/* ============================================================================
   TABLES
   ============================================================================ */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
}

.table thead {
  background: var(--c-surface-light);
}

.table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}

.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--c-border);
}

.table tbody tr:hover {
  background: var(--c-surface-light);
}

/* ============================================================================
   BADGE
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge--success {
  background: var(--c-success-bg);
  color: var(--c-success);
}

.badge--warning {
  background: var(--c-warn-bg);
  color: var(--c-warn);
}

.badge--error {
  background: var(--c-error-bg);
  color: var(--c-error);
}

.badge--info {
  background: var(--c-accent-bg);
  color: var(--c-accent);
}

/* ============================================================================
   SECTIONS
   ============================================================================ */

.section {
  padding: var(--space-2xl) var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.section h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-lg);
  color: var(--c-text);
}

.section h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  color: var(--c-text);
}

.section p {
  color: var(--c-text-light);
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
  background: var(--c-text);
  color: white;
  padding: var(--space-2xl) var(--space-lg);
  margin-top: auto;
  text-align: center;
}

.footer a {
  color: var(--c-accent-light);
}

.footer a:hover {
  color: white;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.footer-copyright {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.mt { margin-top: var(--space-md); }
.mb { margin-bottom: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--c-text-light); }

.hidden { display: none !important; }
.visible { display: block !important; }

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================ */

@media (max-width: 768px) {
  :root {
    --font-size-base: 15px;
    --space-md: 12px;
    --space-lg: 16px;
  }

  .section {
    padding: var(--space-xl) var(--space-md);
  }

  .card {
    padding: var(--space-md);
  }
}
