/**
 * Kienzle Immobilien - Global Styles
 * Bootstrap 5 Compatible
 */

/* ===================================
   CSS VARIABLES
   =================================== */
:root {
    --primary-color: #fe0000;
    --primary-hover: #cb0000;
    --secondary-color: #60a7d5;
    --dark-color: #1f2937;
    --light-gray: #f3f4f6;
    --border-gray: #e5e7eb;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ===================================
   GLOBAL RESETS
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.125rem;
    font-weight: 300;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
header {
    z-index: 1000;
    transition: var(--transition);
}

header.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand img {
    transition: var(--transition);
    max-width: 100%;
    height: auto;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: var(--primary-color);
}

.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    border-radius: 0.375rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===================================
   CARDS
   =================================== */
.card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.card-img-top {
    transition: var(--transition);
    height: 250px;
    object-fit: cover;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.service-card {
    height: 100%;
}

/* ===================================
   FORMS
   =================================== */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--border-gray);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-range {
    height: 6px;
}

.form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    background-color: var(--primary-color);
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===================================
   SECTIONS
   =================================== */
section {
    position: relative;
}

.bg-dark-gradient {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.section-title {
    margin-bottom: 3rem;
}

/* ===================================
   FOOTER
   =================================== */
footer {
    margin-top: auto;
}

.footer-links h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-links a {
    transition: var(--transition);
}

.footer-links a:hover,
.hover-white:hover {
    color: white !important;
    padding-left: 5px;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
}

/* ===================================
   ACCORDION
   =================================== */
.accordion-button {
    font-weight: 600;
    background-color: white;
}

.accordion-button:not(.collapsed) {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* ===================================
   UTILITIES
   =================================== */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--light-gray) !important;
}

.z-index-1 {
    z-index: 1;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===================================
   LOADING STATES
   =================================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   CUSTOM SCROLLBAR
   =================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }
}

@media (max-width: 992px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        background-color: white;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-md);
    }

    .nav-link.active::after {
        display: none;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .btn {
        width: 100%;
    }

    .card-img-top {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        width: 120px;
        height: auto;
    }

    section {
        padding: 2rem 0 !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    header,
    footer,
    .btn,
    .navbar {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: underline;
    }
}
