/* =================================
   RESPONSIVE STYLES
   ================================= */

/* Tablet Landscape (1024px und kleiner) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0;
    }

    /* Header Anpassungen */
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        font-size: 1.5rem;
        justify-content: center;
    }

    .header-title-container {
        text-align: center;
        margin-left: 0;
    }

    .user-area {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Offers List */
    #offersList {
        padding-left: 5%;
        padding-right: 5%;
    }

    /* Sidebar anpassen */
    .sidebar {
        position: relative;
        width: 100%;
        ;
    }

    .sidebar .filter-section {
        flex-direction: column;
        gap: 1rem;
    }

    /* Profile Form - Responsive für Tablets */
    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-section {
        padding: 1rem;
    }

    .sidebar .filter-group {
        width: 100%;
        margin: 0;
    }

    .content-area {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Tab Buttons */
    .tab-btn,
    #UebersichtTabButton,
    #createTabButton {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .switching-button-heading {
        display: none;
    }

    /* Offer Cards */
    .offer-card {
        margin-bottom: 1.5rem;
    }

    .offer-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .detail-item {
        padding: 0.4rem;
        justify-content: flex-start;
    }

    /* Modal */
    .modal-content {
        min-width: auto;
        width: 90%;
        padding: 1.5rem;
        margin: 2rem auto;
    }

    /* Pagination */
    .pagination-buttons {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .pagination-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .page-number {
        padding: 0.4rem 0.6rem;
        min-width: 32px;
    }
}

/* Tablet Portrait (768px und kleiner) */
@media screen and (max-width: 768px) {

    /* Header */
    .header {
        padding: 0.8rem;
    }

    /* =================================
       SIDEBAR MOBILE STABILITY FIX
       ================================= */
    #offers {
        display: block;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 0 1rem 0 !important;
        padding: 0.75rem !important;
        background: transparent !important;
        z-index: 1 !important;
    }

    .sidebar {
        display: block !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        
      ;
        background: transparent !important;
        z-index: 1 !important;
    }

    #offers .sidebar-toggle {
        display: flex !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
        padding: 0.6rem 0.8rem !important;
        background: rgba(0, 0, 0, 0.65) !important;
        z-index: 2 !important;
    }

    #offers .sidebar .sidebar-content {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    #offers .sidebar.expanded .sidebar-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    #offers .sidebar .filter-section {
        display: flex !important;
        flex-direction: column !important;
        gap: 0rem !important;
    }

    #offers .sidebar .filter-group {
        width: 100% !important;
    }

    .footer-content {
        display: none;
    }

    .logo {
        font-size: 1.3rem;
        flex-direction: column;
        text-align: center;
    }

    #logo-header {
        width: 45px;
        height: 45px;
    }

    .header-title-container p {
        font-size: 14px;
    }

    /* User Area - Kompakter */
    .user-area {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .user-area button {
        width: 100%;
        min-width: 200px;
        text-align: center;
    }

    #ForumTabButton {
        order: 99;
        /* Ans Ende */
    }

    /* Sidebar komplett überarbeiten */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-105%);
        width: min(80%, 320px);
        max-width: calc(100vw - 1rem);
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        z-index: 9999;
        transition: transform 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
      
    }

    .sidebar.expanded {
        transform: translateX(0);
    }

    .sidebar-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 10000;
        background: #333;
        color: white;
        border: none;
        padding: 0.8rem;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Overlay für Sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
    }

    .sidebar.expanded~.sidebar-overlay {
        display: block;
    }

    /* Filter Gruppen vertikal */
    .sidebar .filter-section {
        flex-direction: column;
    }

    .sidebar .filter-group {
        width: 100%;
        margin-bottom: 0;
    }

    /* Offers List */
    #offersList {
        padding-left: 2%;
        padding-right: 2%;
        margin-top: 2rem;
    }

    /* Offer Cards */
    .offer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-left: 0.5rem;
    }

    .offer-title {
        font-size: 1.1rem;
    }

    .offer-details {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-item {
        padding: 0.5rem;
        border-bottom: 1px solid #333;
    }

    .detail-item:last-child {
        border-bottom: none;
    }

    /* Tab Content */
    .tab-content {
        margin-top: 1rem;

    }

    /* Profile */
    #profile {
        flex-direction: column;
        padding: 1rem;
    }

    .profile-form {
        width: 100%;
        min-width: auto;
    }

    .form-group {
        width: 100%;
    }

    .submit-btn {
        width: 100%;
        margin: 1rem 0;
    }

    /* Create Offer Form */
    .offer-form {
        width: 100%;
        padding: 1rem;
    }

    /* Inbox */
    .inbox-message {
        width: 100%;
        margin-bottom: 1rem;
    }

    .inbox-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .reply-btn,
    .quick-reply-btn {
        width: 100%;
        text-align: center;
    }

    /* Chat Modal */
    .chat-modal-content {
        width: 95%;
        height: 90%;
        margin: 1rem auto;
    }

    .chat-header {
        padding: 0.8rem;
    }

    .chat-partner-info h3 {
        font-size: 1rem;
    }

    .chat-controls {
        gap: 0.3rem;
    }

    .chat-block-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .chat-input-area {
        padding: 0.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    #chatInput,
    #chatMessageInput {
        width: 100%;
        min-height: 60px;
    }

    .chat-send-btn {
        width: 100%;
        padding: 1rem;
    }

    /* Footer */
    .site-footer {
        padding: 1.5rem 0 1rem 0;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.8rem;
    }

    /* Pagination Mobile */
    .pagination-controls {
        padding: 1rem;
    }

    .pagination-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-numbers {
        order: -1;
        margin: 0 0 1rem 0;
    }

    .pagination-btn {
        min-width: 150px;
        justify-content: center;
    }
}

/* Mobile Portrait (480px und kleiner) */
@media screen and (max-width: 480px) {

    /* Basis Typography */
    body {
        font-size: 14px;
    }

    h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Header noch kompakter */
    .header {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    #logo-header {
        width: 40px;
        height: 40px;
    }

    .header-title-container p {
        font-size: 12px;
    }

    /* User Area */
    .user-area button {
        min-width: 100%;
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    /* Sidebar */
    .sidebar {
        width: 90%;
    }

    .sidebar-toggle {
        width: 45px;
        height: 45px;
        top: 0.5rem;
        left: 0.5rem;
    }

    /* Offers */
    #offersList {
        padding-left: 1%;
        padding-right: 1%;
        margin-top: 1rem;
    }

    .offer-card {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }

    .offer-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .offer-status {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        margin-left: 80%
    }

    .detail-item {
        padding: 0.4rem;
        font-size: 0.9rem;
    }

    .detail-item i {
        font-size: 0.8rem;
        min-width: 20px;
    }

    .contact-btn {
        width: 100%;
        margin-top: 1rem;
        padding: 0.8rem;
    }

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

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.5rem;
        font-size: 12px;
        /* Verhindert Zoom auf iOS */
    }

    .submit-btn {
        padding: 1rem 2rem;
        font-size: 1rem;

    }

    /* Modal */
    .modal-content {
        width: 100%;
        padding: 3rem;
        margin: 0rem auto;
        min-height: fit-content;
        border: none;
    }

   

    /* Chat */
    .chat-modal-content {
        width: 98%;
        height: 95%;
        margin: 0.5rem auto;
    }

    .chat-header {
        padding: 0.6rem;
    }

    .chat-partner-info h3 {
        font-size: 0.9rem;
    }

    .chat-status {
        font-size: 0.7rem;
    }

    .chat-message {
        max-width: 90%;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .chat-input-area {
        padding: 0.6rem;
    }

    #chatInput,
    #chatMessageInput {
        font-size: 16px;
        /* Verhindert Zoom */
        min-height: 50px;
    }

    /* Inbox */
    .inbox-message {
        padding: 1rem;
    }

    .inbox-sender {
        font-size: 1rem;
    }

    .inbox-date {
        font-size: 0.8rem;
    }

    .inbox-message-body {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Profile */
    .liElement {
        padding: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .liElement a {
        width: 100%;
        font-size: 0.9rem;
    }

    .li-delete-button {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
        border-radius: 8px;
    }

    /* Footer */
    .site-footer {
        padding: 1rem 0;
    }

    .footer-meta {
        font-size: 0.8rem;
        padding: 0 1rem;
        text-align: center;
    }

    /* Pagination Mobile Optimiert */
    .pagination-controls {
        padding: 0.8rem;
        margin: 1rem 0;
    }

    .pagination-info {
        font-size: 0.8rem;
        text-align: center;
    }

    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.2rem;
    }

    .page-number {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 28px;
    }

    .pagination-btn {
        min-width: 120px;
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    /* Filter Chips Mobile */
    .filter-chip {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        margin: 0.2rem 0.1rem;
    }

    .chip-remove {
        font-size: 1.2rem;
        right: -3px;
        top: -2px;
    }

    /* Loading */
    .loading-bar-container {
        width: 90%;
        margin: 40px auto;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        margin: 40px auto;
    }

    .loading-spinner .ring {
        width: 50px;
        height: 50px;
        border: 6px solid transparent;
        border-top: 6px solid #222;
    }

    .loading-spinner .ring2 {
        width: 38px;
        height: 38px;
        border: 6px solid transparent;
        border-top: 2px solid #d90429;
    }

    .loading-spinner .ring3 {
        width: 26px;
        height: 26px;
        border: 6px solid transparent;
        border-top: 6px solid #fec850;
    }
}

/* Landscape Handy (kleine Höhe) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 0.3rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .main-content {
        margin-top: 80px;
    }

    .chat-modal-content {
        height: 98vh;
        margin: 1vh auto;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .sidebar {
        height: calc(100vh - 80px);
        top: 80px;
    }
}

/* Touch Optimierungen */
@media (hover: none) and (pointer: coarse) {

    /* Größere Touch-Targets */
    .tab-btn,
    .contact-btn,
    .submit-btn,
    .reply-btn,
    .quick-reply-btn,
    .pagination-btn,
    .page-number {
        min-height: 44px;
        min-width: 44px;
    }

    /* Hover-Effekte entfernen */
    .offer-card:hover,
    .inbox-message:hover,
    .liElement:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Focus für Keyboard Navigation */
    .tab-btn:focus,
    .contact-btn:focus,
    .submit-btn:focus {
        outline: 2px solid #fec850;
        outline-offset: 2px;
    }
}

/* Dark Mode System Preference Support */
@media (prefers-color-scheme: dark) {
    /* Bereits dunkel optimiert */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading-spinner .ring,
    .loading-spinner .ring2,
    .loading-spinner .ring3 {
        animation: none;
    }

    .loading-bar-progress {
        animation: none;
        width: 100%;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {

    .offer-card,
    .inbox-message,
    .modal-content {
        border: 2px solid #fff;
    }

    .tab-btn,
    .contact-btn,
    .submit-btn {
        border: 1px solid #fff;
    }

    .tab-btn.active {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {

    .header,
    .sidebar,
    .chat-modal,
    .login-modal,
    .pagination-controls,
    .footer {
        display: none !important;
    }

    .offer-card {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .offer-description {
        opacity: 1 !important;
        max-height: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }
}

/* =================================
   BURGER MENU FÜR MOBILE
   ================================= */

/* Burger Menu Button */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 1.7rem;
    height: 1.7rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 0.4rem;
    z-index: 10001;
    position: relative;
}

.burger-menu:focus {
    outline: none;
}

.burger-line {
    width: 1.7rem;
    height: 0.2rem;
    background: #fff;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Burger Animation beim Öffnen */
.burger-menu.open .burger-line:nth-child(1) {
    transform: rotate(45deg);
}

.burger-menu.open .burger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.burger-menu.open .burger-line:nth-child(3) {
    transform: rotate(-45deg);
}

#ForumTabButtonMobile {
    color: #848484;
}

/* Mobile Navigation Menu */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(105%);
    width: min(80%, 300px);
    max-width: calc(100vw - 1rem);
    height: 100vh;
    background-color: #00000076;
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-in-out;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 4rem;
}

.mobile-nav.open {
    transform: translateX(0);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Items */
.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background: rgba(254, 199, 80, 0);
    color: #1D8E93;
}

.mobile-nav-link i {
    margin-right: 0.8rem;
    font-size: 1.1rem;
    min-width: 20px;
}

.mobile-nav-link.active {
    background: rgba(0, 0, 0, 0);
    color: #1D8E93;
    border-left: 4px solid #1D8E93;
}

/* User Info in Mobile Menu */
.mobile-user-info {
    display: none !important;
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(254, 200, 80, 0.05);
    margin-bottom: 1rem;
}

.mobile-user-avatar {
    display: none !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1D8E93, #d90429);
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.mobile-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
}

.mobile-user-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile: Header anpassen für Burger Menu */
@media screen and (max-width: 768px) {
    .header {
        position: sticky;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;

        backdrop-filter: blur(10px);
        width: 100%;
    }

    .logo {
        flex-direction: row;
        gap: 0.8rem;
        font-size: 1.2rem;
    }

    .header-title-container {
        text-align: left;
        margin-left: 0;
    }

    .header-title-container h1 {
        font-size: 1.5rem;
        margin: 0;
    }

    .header-title-container p {
        font-size: 0.8rem;
        margin: 0;
    }

    /* User Area verstecken - wird durch Burger Menu ersetzt */
    .user-area {
        display: none;
    }

    /* Burger Menu anzeigen */
    .burger-menu {
        display: flex;
    }

    /* Main Content Anpassung */
    .main-content {
        margin-top: 0;
        padding-top: 1rem;
    }

    /* Tab Content für mobile */
    .tab-content {
        margin-top: 0;
        padding: 1rem;
        min-height: 0px;
    }
}

@media screen and (max-width: 480px) {
    .header {
        padding: 0.8rem;
    }

    .logo {
        font-size: 1rem;
    }

    .header-title-container h1 {
        font-size: 1.3rem;
    }

    .header-title-container p {
        font-size: 0.7rem;
    }

    #logo-header {
        width: 35px;
        height: 35px;
    }

    .burger-menu {
        width: 1.8rem;
        height: 1.8rem;
    }

    .burger-line {
        width: 1.8rem;
        height: 0.2rem;
    }

    .mobile-nav {
        width: 85%;
        padding-top: 3.5rem;
    }

    .mobile-user-info {
        padding: 1rem;
    }

    .mobile-user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* ================================================
   ULTRA-SMALL DEVICES (Smartphones 320px - 480px)
   ================================================
   Optimiert für die kleinsten Smartphone-Displays
   Primärer Fokus: Vermeidung von horizontalem Scrollen
   und Touch-optimierte Abstände
*/
@media screen and (max-width: 480px) {
    
    /* === HEADER & NAVIGATION === */
    /* KRITISCH: Header muss flex-row bleiben für korrekte Anordnung */
    .header {
        padding: 0.65rem 0.95rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    /* Logo und Titel zusammen auf linker Seite */
    .logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }

    .logo-img-multiborder {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    #logo-header {
        width: 40px;
        height: 40px;
        padding: 3px;
        border-radius: 50%;
    }

    .header-title-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        flex: 1;
    }

    .header-title-container h1 {
        font-size: 1rem;
        line-height: 1.1;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #header-p {
        font-size: 0.78em;
        margin-top: 5px;
        
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* KRITISCH: User-Area muss auf Mobile versteckt sein */
    .user-area {
        display: none;
    }

    /* Burger-Menü Button */
    .burger-menu {
        display: flex !important;
        order: 10;
        margin-left: 0.5rem;
        margin-right: 0.45rem;
        width: 1.55rem;
        height: 1.55rem;
    }

    /* ===  TAB BUTTONS === */
    /* Tab-Button Text wurde bei 1024px versteckt, aber Buttons brauchen mobile-Anpassung */
    .tab-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        flex: 1;
        min-width: 50px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .switching-button-heading {
        display: none;
    }

    .inbox-btn,
    .profile-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    /* ===  MAIN CONTENT AREA === */
    .content-area {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        width: 100%;
    }

    /* === SIDEBAR === */
    /* Filter sollten sichtbar bleiben, aber vertikal angeordnet */
    .sidebar {
        width: 100%;
     
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-height: auto;
        overflow: visible;
        position: relative;
    }

    .sidebar.expanded {
        position: relative;
        width: 100%;
        height: auto;
        z-index: 100;
        max-width: 100%;
    }

    /* KRITISCH: Filter-Gruppen sollten sichtbar bleiben */
    .sidebar .filter-section {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    /* Filter-Groups vertikal stauchen */
    .filter-group {
        width: 100%;
        padding: 0.5rem;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }

    .filter-group label {
        font-size: 0.8rem;
        font-weight: 600;
    }

    .filter-group select,
    .filter-group input {
        font-size: 0.8rem;
        padding: 0.4rem;
        width: 100%;
    }

    /* ===  OFFERS LIST  === */
    /* KRITISCH: 23% Padding bei 320px = nur 172px verfügbar für Cards */
    #offersList {
        padding-left: 4%;
        padding-right: 4%;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* === OFFER CARDS === */
    .offer-card {
        padding: 0.9rem;
        margin-bottom: 1rem;
        width: 100%;
        overflow: hidden;
        border-radius: 12px;
    }

    /* KRITISCH: Offer-Header passt nicht auf 320px */
    .offer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        margin-left: 0;
        width: 100%;
    }

    .offer-title {
        font-size: 1rem;
        max-width: 100%;
        word-wrap: break-word;
    }

    .offer-status {
        align-self: flex-start;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Offer-Details für kleine Screens optimieren */
    .offer-details {
        flex-direction: column;
        gap: 0.3rem;
        margin-left: 0;
    }

    .detail-item {
        padding: 0.3rem 0;
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .detail-item i {
        font-size: 0.8rem;
        min-width: 16px;
    }

    /* === OFFER DESCRIPTION === */
    /* KRITISCH: Absolute Positioning der Anzeigen-ID überlagert Text */
    .offer-description {
        padding: 0.5rem 0;
    }

    .offer-description-paragraph {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        line-height: 1.3;
    }

    .offer-description-paragraph:first-of-type {
        position: static;
        margin: 0 0 0.5rem 0;
        display: flex;
        background: transparent;
        padding: 0;
        border-radius: 0;
        font-size: 0.78rem;
        z-index: auto;
    }

    /* Header-Styling auch auf Mobile korrekt */
    .offer-description-header {
        flex-wrap: wrap;
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
        padding-bottom: 0.2rem;
    }

    .offer-description-content {
        margin-left: 0.5rem;
        font-size: 0.75rem;
    }

    /* === FORMS === */
    .profile-form {
        max-width: 100%;
        
    }

    .profile-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .profile-section h4 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    /* Form Rows: von 2-spaltig zu 1-spaltig */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.85rem;
        padding: 0.4rem;
        border-radius: 6px;
        margin-top: 0.2rem;
    }

    .form-group textarea {
        resize: vertical;
        max-height: 200px;
    }

    /* === BUTTONS === */
    .submit-btn,
    .delete-btn {
        width: 100%;
        padding: 0.6rem 1rem;
        margin: 1.5rem 0;
        font-size: 0.85rem;
    }

    .delete-account-btn {
        width: auto;
        margin-top: 0;
    }

    .profile-actions {
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }

    .profile-actions .submit-btn,
    .profile-actions .delete-account-btn {
        width: 100%;
        flex: 1 1 calc(50% - 0.25rem);
        margin: 0;
        padding: 0.6rem 0.8rem;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        padding-left: 20%;  
        padding-right: 20%;
    }

    .contact-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.8rem;   
      

     
    }



    /* === MODALS === */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        padding: 1rem;
        margin: 10vh auto;
    }

    .modal-header {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-body {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    /* === CHECKBOXES & LABELS === */
    .checkbox-label {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* === OFFER FORM (CREATE) === */
    .offer-form {
        width: 100%;
        padding: 0.5rem;
    }

    .offer-form h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    /* === ACTIVITY SECTION === */
    .activity-section {
        padding: 0.5rem;
        margin-top: 3rem;
    }

    .activity-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .ULElementsProfile {
        padding-left: 0;
    }

    .liElement {
        padding: 0.5rem;
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .li-delete-button {
        align-self: flex-start;
        padding: 0.4rem;
    }

    .site-footer {
        display: block !important;
        margin-top: 1.25rem;
        padding-top: 1.2rem;
        padding-bottom: 1rem;
    }

    .footer-links {
        width: 100%;
        gap: 0.65rem;
    }

    /* === LANDSCAPE MODE (Mobile) === */
    /* Verhindert zu hohes Layout bei Landscape-Orientierung */
    @media (max-height: 500px) and (orientation: landscape) {
        .header {
            padding: 0.3rem 0.5rem;
            gap: 0.25rem;
        }

        #logo-header {
            width: 35px;
            height: 35px;
        }

        .header-title-container h1 {
            font-size: 0.85rem;
        }

        .tab-btn {
            padding: 0.4rem;
            font-size: 0.65rem;
        }

        .sidebar {
            max-height: 80vh;
        }
    }
}

/* ================================================
   SMALL DEVICES (Tablets & Large Phones 481px - 767px)
   ================================================
   Übergangsgröße zwischen Mobile und Tablet
   Fokus: Bessere Ausnutzung der Breite, aber noch mobile-optimiert
*/
@media screen and (max-width: 767px) and (min-width: 481px) {
    
    /* === HEADER === */
    .header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    #logo-header {
        width: 45px;
        height: 45px;
        padding: 4px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .header-title-container h1 {
        font-size: 1.05rem;
    }

    #header-p {
        font-size: 0.7rem;
    }

    /* === USER AREA === */
    /* Auf Tablets auch verstecken - nur Burger-Menü verwenden */
    .user-area {
        display: none;
    }

    /* Burger-Menü Button anzeigen */
    .burger-menu {
        display: flex !important;
    }

    .user-area button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    /* === MAIN CONTENT === */
    .content-area {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* === SIDEBAR === */
    .sidebar {
        width: 100%;
    
    }

    /* === OFFERS LIST === */
    /* Breite padding reduzieren für bessere Kartennutzung */
    #offersList {
        padding-left: 2%;
        padding-right: 2%;
    }

    /* === OFFER CARDS === */
    .offer-card {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .offer-title {
        font-size: 1.05rem;
    }

    .detail-item {
        padding: 0.35rem 0;
        font-size: 0.9rem;
    }

    /* === DESCRIPTION === */
    .offer-description-paragraph {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .offer-description-content {
        font-size: 0.8rem;
        margin-left: 1.2rem;
    }

    /* === FORMS === */
    .profile-form {
        max-width: 100%;
        padding: 0.75rem;
    }

    .profile-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    /* === BUTTONS === */
    .submit-btn,
    .delete-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* === MODALS === */
    .modal-content {
        width: 90%;
        max-width: 90vw;
        padding: 1.2rem;
    }
}

/* ================================================
   TABLETS (768px - 1024px)
   ================================================
   Tablet-optimiertes Layout
   Fokus: Bessere Spalten-Nutzung, aber noch touch-freundlich
*/
@media screen and (max-width: 1024px) and (min-width: 768px) {
    
    /* === HEADER === */
    .header {
        padding: 1rem 1.2rem;
        gap: 1rem;
    }

    #logo-header {
        width: 50px;
        height: 50px;
    }

    .logo {
        font-size: 1.4rem;
    }

    /* === SIDEBAR === */
    .sidebar {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .sidebar .filter-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .filter-group {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 200px;
    }

    /* === OFFERS LIST === */
    #offersList {
        padding-left: 3%;
        padding-right: 3%;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Offer-Cards in 2-Spalten bei Tablets */
    .offer-card {
        padding: 1rem;
        margin-bottom: 1.2rem;
        width: 100%;
    }

    /* === FORMS === */
    .profile-form {
        max-width: 100%;
        padding: 1rem;
    }

    .profile-section {
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }

    /* Form Row: Von 1 zu 2 Spalten zurück für Tablets */
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* === MODALS === */
    .modal-content {
        width: 85%;
        max-width: 500px;
        padding: 1.5rem;
    }

    /* === BUTTONS === */
    .submit-btn,
    .delete-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ================================================
   SMALL LANDSCAPE (z.B. iPhone SE im Landscape)
   ================================================
   Spezielle Optimierung für kleine Screens im Landscape
*/
@media screen and (max-width: 812px) and (max-height: 400px) and (orientation: landscape) {
    
    .header {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    #logo-header {
        width: 35px;
        height: 35px;
    }

    .header-title-container {
        display: none;
    }

    .user-area {
        width: 100%;
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.4rem;
        font-size: 0.7rem;
    }

    .offer-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .offer-title {
        font-size: 0.95rem;
    }

    .detail-item {
        padding: 0.2rem 0;
        font-size: 0.8rem;
    }
}

/* Desktop: Burger Menu verstecken */
/* Profile Form - Responsive */
.form-row {
    grid-template-columns: 1fr 1fr;
}

@media screen and (min-width: 769px) {

    .burger-menu,
    .mobile-nav,
    .mobile-nav-overlay,
    .sidebar-toggle {
        display: none !important;
    }
}

/* Mobile Navigation Badge für Nachrichten */
.mobile-badge {
    background: #d90429;
    color: #fff;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* =================================
   SIDEBAR TOGGLE MIT FILTER DESIGN
   ================================= */


.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-toggle-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-toggle-icon {
    font-size: 1rem;
    color: #fec850;
    transition: all 0.3s ease;
}

.sidebar-toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-toggle-badge {
    background: #fec850;
    color: #1a1a1a;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Responsive Anpassungen */
@media screen and (max-width: 768px) {
    html,
    body,
    .container,
    .main-content,
    .content-area,
    #offers,
    #offersList,
    .offers-list-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar-toggle-container {
        position: fixed;
        top: 80px;
        left: 1rem;
        right: 1rem;
        z-index: 9997;
        margin-bottom: 0;
    }

    .sidebar .sidebar-content {
        display: none;
        pointer-events: none;
    }

    .sidebar.expanded .sidebar-content {
        display: block;
        pointer-events: auto;
    }

    .sidebar-toggle {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 480px) {
    .sidebar-toggle-container {
        top: 70px;
        left: 0.5rem;
        right: 0.5rem;
    }

    .sidebar-toggle {
        padding: 0.5rem 0.6rem;
    }

    .sidebar-toggle-text {
        font-size: 0.8rem;
    }
}

/* Sidebar erweitert Zustand */
.sidebar.expanded .sidebar-toggle-container {
    position: relative;
    top: 0;
    margin-bottom: 1.5rem;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.sidebar.expanded .sidebar-toggle::before {
    opacity: 0.5;
}

.sidebar.expanded .sidebar-toggle-icon {
    transform: rotate(180deg);
    color: #d90429;
}

/* Glow Effekt für aktive Filter */
.sidebar-toggle-container.has-active-filters {
    animation: filterGlow 3s ease-in-out infinite alternate;
}

@keyframes filterGlow {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    100% {
        box-shadow: 0 6px 30px rgba(254, 200, 80, 0.4),
            0 0 20px rgba(254, 200, 80, 0.2);
    }
}

/* Accessibility */
.sidebar-toggle:focus {
    outline: 2px solid #fec850;
    outline-offset: 2px;
}

.sidebar-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* =================================
   TAB CONTENT DISPLAY FIX - VERSTÄRKT
   ================================= */

/* ALLE Tab Contents standardmäßig verstecken - HÖCHSTE PRIORITÄT */
.tab-content {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: static !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
}

/* NUR der aktive Tab wird angezeigt - ÜBERSCHREIBT ALLES */
.tab-content.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

/* Mobile spezifische Überschreibungen */
@media screen and (max-width: 768px) {

    /* Sicherstellen dass nur ein Tab sichtbar ist */
    .tab-content {
        display: none !important;
        position: static !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        visibility: hidden !important;
        opacity: 0 !important;
        overflow: hidden !important;
    }

    .tab-content.active {
        display: block !important;
        position: relative !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 1rem !important;
        margin-top: 0 !important;
    }

    /* Spezielle Behandlung für verschiedene Tab-Typen */
    #offers.tab-content.active {
        display: block !important;
    }

    #create.tab-content.active {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    #profile.tab-content.active {
        display: block !important;
    }

    #inbox.tab-content.active {
        display: block !important;
    }
}