/* 
 * BERLIN IMMOBILIEN - Responsive Styles
 * Mobile-first responsive design for the real estate website
 */

/* ===== BASE RESPONSIVE SETUP ===== */
:root {
  --container-padding: 1rem;
  --container-max-width-sm: 540px;
  --container-max-width-md: 720px;
  --container-max-width-lg: 960px;
  --container-max-width-xl: 1140px;
  --container-max-width-xxl: 1320px;
}

/* Base container setup */
.container {
  width: 100%;
  padding-right: var(--container-padding);
  padding-left: var(--container-padding);
  margin-right: auto;
  margin-left: auto;
}

/* ===== MOBILE FIRST BREAKPOINTS ===== */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: var(--container-max-width-sm);
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 2.75rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  /* Hero section adjustments */
  .hero {
    min-height: 500px;
  }
  
  /* Property card adjustments */
  .property-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    max-width: var(--container-max-width-md);
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  
  /* Navigation adjustments */
  .navbar-collapse {
    padding-top: 0;
  }
  
  /* Grid system */
  .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
  
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  /* Hero section adjustments */
  .hero-content {
    max-width: 600px;
  }
  
  .hero-search-form {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Property grid adjustments */
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Features section */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Blog grid */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Footer adjustments */
  .footer-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: var(--container-max-width-lg);
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 3.5rem;
  }
  
  h2 {
    font-size: 2.75rem;
  }
  
  /* Navigation adjustments */
  .navbar-toggler {
    display: none;
  }
  
  .navbar-collapse {
    position: static;
    transform: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  
  .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .nav-item {
    margin-left: 1.5rem;
    margin-bottom: 0;
  }
  
  .nav-link {
    padding: 0;
  }
  
  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 10rem;
    margin-top: 0.5rem;
  }
  
  /* Grid system */
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  
  /* Hero section adjustments */
  .hero-content {
    max-width: 700px;
  }
  
  .hero-search-form {
    grid-template-columns: 1fr 1fr 1fr auto;
  }
  
  /* Property grid adjustments */
  .property-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Features section */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Blog grid */
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Footer adjustments */
  .footer-widgets {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Two column layout */
  .two-column-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
  
  /* Property detail layout */
  .property-detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: var(--container-max-width-xl);
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 4rem;
  }
  
  h2 {
    font-size: 3rem;
  }
  
  /* Hero section adjustments */
  .hero-content {
    max-width: 800px;
  }
}

/* Extra extra large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: var(--container-max-width-xxl);
  }
}

/* ===== SPECIFIC COMPONENT RESPONSIVE STYLES ===== */

/* Navigation */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    padding-top: 5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1030;
    overflow-y: auto;
  }
  
  .navbar-collapse.show {
    transform: translateX(0);
  }
  
  .navbar-toggler {
    display: block;
    z-index: 1031;
  }
  
  .nav-item {
    margin-bottom: 0.5rem;
  }
  
  .nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
  }
  
  .dropdown-menu {
    border: none;
    background-color: rgba(0, 0, 0, 0.05);
    box-shadow: none;
    padding-left: 1.5rem;
  }
  
  .dropdown-item {
    padding: 0.5rem 1rem;
  }
}

/* Hero Section */
@media (max-width: 767.98px) {
  .hero {
    height: auto;
    min-height: 500px;
    padding-top: 6rem;
    padding-bottom: 3rem;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-search {
    margin-top: 2rem;
  }
  
  .hero-search-form {
    grid-template-columns: 1fr;
  }
}

/* Property Cards */
@media (max-width: 575.98px) {
  .property-card {
    margin-bottom: 1.5rem;
  }
  
  .property-img-container {
    padding-top: 75%; /* 4:3 aspect ratio for smaller screens */
  }
  
  .property-content {
    padding: 1rem;
  }
  
  .property-title {
    font-size: 1.125rem;
  }
  
  .property-price {
    font-size: 1.25rem;
  }
  
  .property-features {
    flex-wrap: wrap;
  }
  
  .property-feature {
    flex: 0 0 33.333333%;
    margin-bottom: 0.5rem;
  }
}

/* Features Section */
@media (max-width: 767.98px) {
  .features {
    padding: 3rem 0;
  }
  
  .feature-card {
    margin-bottom: 1.5rem;
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Testimonials */
@media (max-width: 767.98px) {
  .testimonial-slide {
    padding: 1.5rem;
  }
  
  .testimonial-quote {
    font-size: 1rem;
  }
  
  .testimonial-author-img {
    width: 3rem;
    height: 3rem;
  }
}

/* Blog Cards */
@media (max-width: 767.98px) {
  .blog-card {
    margin-bottom: 1.5rem;
  }
  
  .blog-content {
    padding: 1rem;
  }
  
  .blog-title {
    font-size: 1.125rem;
  }
}

/* Footer */
@media (max-width: 767.98px) {
  .footer {
    padding: 3rem 0 1.5rem;
  }
  
  .footer-widget {
    margin-bottom: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-copyright {
    margin-bottom: 1rem;
  }
  
  .footer-bottom-links {
    justify-content: center;
  }
}

/* Property Detail Page */
@media (max-width: 991.98px) {
  .property-detail-layout {
    display: block;
  }
  
  .property-detail-sidebar {
    margin-top: 2rem;
    position: static;
  }
  
  .property-detail-main-img {
    height: 300px;
  }
  
  .property-detail-thumbnails {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .property-detail-thumbnail {
    height: 80px;
  }
}

/* Blog Detail Page */
@media (max-width: 767.98px) {
  .blog-detail-img {
    height: 300px;
  }
  
  .blog-detail-author {
    flex-direction: column;
    text-align: center;
  }
  
  .blog-detail-author-img {
    margin: 0 auto 1rem;
  }
  
  .blog-detail-comment {
    flex-direction: column;
  }
  
  .blog-detail-comment-img {
    margin: 0 auto 1rem;
  }
  
  .blog-detail-comment-replies {
    margin-left: 1.5rem;
  }
}

/* Map Container */
@media (max-width: 767.98px) {
  .map-container {
    height: 300px;
  }
}

/* Virtual Tour */
@media (max-width: 767.98px) {
  .virtual-tour-container {
    height: 300px;
  }
  
  .virtual-tour-play {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Calculator */
@media (max-width: 767.98px) {
  .calculator {
    padding: 1.5rem;
  }
  
  .calculator-result-value {
    font-size: 1.5rem;
  }
}

/* Chatbot */
@media (max-width: 575.98px) {
  .chatbot-container {
    width: 300px;
    height: 450px;
    right: -10px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .footer,
  .cta,
  .hero-search,
  .property-actions,
  .btn,
  .chatbot,
  .notification {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .container {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  
  .property-card,
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .property-img-container {
    height: 200pt;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  }
  
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img {
    page-break-inside: avoid;
    max-width: 100% !important;
  }
  
  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }
  
  .property-detail-layout,
  .two-column-layout {
    display: block;
  }
  
  .property-detail-sidebar {
    margin-top: 2rem;
  }
  
  .property-detail-features,
  .property-detail-amenities {
    page-break-inside: avoid;
  }
}

/* ===== ACCESSIBILITY STYLES ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.accessibility-mode {
  --font-size-base: 18px;
  --line-height-base: 1.8;
}

.accessibility-mode .btn,
.accessibility-mode .form-control,
.accessibility-mode .form-select {
  padding: 1rem 1.5rem;
}

.accessibility-mode .navbar-brand,
.accessibility-mode .nav-link,
.accessibility-mode .btn {
  font-weight: 700;
}

.accessibility-mode *:focus {
  outline: 3px solid var(--primary-violet) !important;
  outline-offset: 3px !important;
}

.accessibility-mode .card:hover,
.accessibility-mode .feature-card:hover,
.accessibility-mode .property-card:hover {
  transform: none;
}

/* High contrast mode */
.high-contrast-mode {
  --primary-turquoise: #00ffff;
  --primary-blue: #00ff00;
  --primary-violet: #ff00ff;
  --primary-dark: #000000;
  --primary-light: #ffffff;
  
  --neutral-100: #ffffff;
  --neutral-200: #f0f0f0;
  --neutral-300: #d0d0d0;
  --neutral-400: #a0a0a0;
  --neutral-500: #808080;
  --neutral-600: #606060;
  --neutral-700: #404040;
  --neutral-800: #202020;
  --neutral-900: #000000;
  
  --secondary-yellow: #ffff00;
  --secondary-red: #ff0000;
  --secondary-green: #00ff00;
}

.high-contrast-mode * {
  border-color: #000000 !important;
}

.high-contrast-mode a,
.high-contrast-mode .btn,
.high-contrast-mode .nav-link {
  text-decoration: underline;
}

.high-contrast-mode img {
  filter: contrast(120%);
}