/* 
 * HowMany - Responsive Adjustments
 * All media queries are consolidated here.
 */


/* --- 992px Breakpoint (Desktop/Tablet) --- */
@media (max-width: 992px) {
    .hero-text {
        grid-template-columns: 1fr;
        gap: 0;
        display: block;
    }

    .auth-section {
        margin: 2rem 0;
    }

    .hero-text h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

}

/* --- 768px Breakpoint (Tablet/Large Mobile) --- */
@media (max-width: 768px) {

    html {
        -webkit-text-size-adjust: 100%;
        user-select: none;
    }

    html,
    body {
        -webkit-user-select: none;
        /* Safari (iOS/macOS) */
        -moz-user-select: none;
        /* Firefox */
        -ms-user-select: none;
        /* Legacy IE/Edge */
        user-select: none;
        /* Standard (Chrome, Edge) */

        /* Verhindert das Kontextmenü beim langen Drücken auf Bilder/Links in iOS */
        -webkit-touch-callout: none;
    }

    input,
    textarea,
    .selectable {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }

    body {
        -webkit-tap-highlight-color: transparent;
        color: var(--text-primary);
        font-family: var(--font-main);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        font-variant-numeric: tabular-nums;
        /* Perfekt für Zahlenlisten/Uhrzeiten */
        letter-spacing: -0.011em;
        /* Kommt dem SF Pro Standard sehr nah */
        line-height: 1.6;
        min-height: 100vh;
        overflow-x: hidden;
        padding-bottom: 1em;
        user-select: auto;

        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;

        font-size: 19px;
        /* Entspricht 17px (iOS Standard Body) */
        line-height: 1.4;
        /* Genug Luft zwischen den Zeilen für Schärfe */
    }




    .hide-mobile {
        display: none !important;
    }

    .hide-mobile-flex {
        display: none !important;
    }

    .show-mobile-only {
        display: block !important;
    }


    .container {
        padding: 0 1rem;
    }

    .notification-wrapper {
        position: relative;
    }

    .emoji-circle {
        bottom: 10px;
        right: 10px;
    }

    .main-header h1 {
        font-size: 2.5rem;
    }






    .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .item-input-group.row {
        flex-direction: row !important;
    }



    .row>div {
        width: 100% !important;
        flex: none !important;
        min-width: 0;
    }

    .mobile-nav {
        display: flex;
    }

    header.main-header,
    header.dashboard-header {
        position: relative;
        background: #191922;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1001;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0 !important;
        padding: 0.3rem 0.75rem;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 70px;
        margin-bottom: 0.75rem;
        padding-top: calc(0.3rem + env(safe-area-inset-top));
    }

    .sticky-header .container {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0;
        border: none;
    }

    .sticky-header h1 {
        font-size: 1.1rem !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .sticky-header .back-link {
        font-size: 1.2rem;
        color: var(--text-secondary);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
    }

    .dashboard-header h2 {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    .dashboard-header .header-logo .brand-text,
    .dashboard-header .header-logo {
        font-size: 1.1rem;
    }

    .main-header h1,
    .dashboard-header h2 {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    .main-header p {
        display: none;
    }

    .dashboard-header .btn-secondary {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        border-radius: var(--radius-sm);
    }

    .event-action-buttons {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-top: 1.5rem;
    }

    .event-action-buttons .btn {
        flex: 1 1 calc(50% - 0.75rem);
        min-width: 120px;
        padding: 0.5rem;
    }

    .section-header {
        margin-bottom: 0.75rem !important;
        margin-top: 0.75rem !important;
        gap: 0.5rem !important;
    }

    .section-header h2 {
        font-size: 1.1rem !important;
        gap: 0.5rem !important;
    }

    .section-header h2 svg {
        width: 18px !important;
        height: 18px !important;
    }

    .section-header .btn {
        padding: 0.35rem 0.7rem !important;
        font-size: 0.8rem !important;
    }



    #gdpr-cookie-message {
        left: 15px;
        right: 15px;
        bottom: 85px;
        max-width: none;
    }

    .modal-content {
        padding: 1.5rem;
        border-radius: var(--radius-sm);
    }


    #legal-modal .explorer-scroll-area,
    #legal-modal .modal-content>div:not(.modal-header),
    #info-overlay .modal-content>div:not(.modal-header) {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 1.2rem !important;
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        -webkit-overflow-scrolling: touch;
        max-height: none !important;
    }

    #legal-modal .btn-back {
        margin-right: 0.5rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #details-my-order-container {
        margin-top: 1rem;
    }

    #explorer-view-details:not(.hidden),
    #explorer-view-order:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        height: 100% !important;
        width: 100% !important;
        min-height: 0;
    }

    .explorer-scroll-area {
        flex: 1 1 0% !important;
        min-height: 0;
        overflow-y: auto !important;
        padding: 1.2rem !important;
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        -webkit-overflow-scrolling: touch;
        max-height: none !important;
    }


    #event-explorer-modal .btn-back {
        margin-right: 0.5rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #event-explorer-modal .btn-back:active {
        background: rgba(255, 255, 255, 0.15);
        transform: scale(0.95);
    }
}

/* --- 600px Breakpoint (Medium Mobile) --- */
@media (max-width: 600px) {


    input[type="date"],
    input[type="time"] {
        padding: 0.875rem 0.75rem;
        font-size: 0.95rem;
    }

    .share-box {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
        gap: 1.25rem !important;
    }

    .share-box>div {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .share-box div[style*="display:flex"] {
        flex-direction: column;
        width: 100%;
    }

    .share-box .btn {
        width: 100%;
    }

    .share-box .share-link {
        font-size: 0.85rem;
        padding: 0.875rem;
        margin: 0.25rem 0;
        width: 100%;
        text-align: center;
    }

    .container {
        padding-bottom: 80px;
    }

    .btn:active {
        transform: scale(0.96) !important;
        opacity: 0.9;
    }

    .event-card:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.05);
    }





    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-sm);
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.01);
    }

    td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        padding-left: 50% !important;
        text-align: right !important;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    td:last-child {
        border-bottom: 0;
    }

    td:before {
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
    }

    .col-main-name {
        font-size: 1.1rem;
        color: var(--text-primary);
        border-bottom: 2px solid var(--primary) !important;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        flex-direction: column;
        align-items: flex-start !important;
        padding-left: 1rem !important;
    }

    .col-main-name:before {
        display: none !important;
    }

    .col-order-details {
        text-align: left !important;
        display: block !important;
        height: auto !important;
        padding-top: 2.2rem !important;
        padding-left: 1rem !important;
    }

    .col-order-details:before {
        top: 0.5rem;
        width: 100%;
    }

    .table-responsive {
        overflow: hidden;
    }
}

/* --- 480px Breakpoint (Small Mobile) --- */
@media (max-width: 480px) {
    .modal-content {
        padding: 1rem;
    }





    .emoji-picker-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 10px !important;
        padding: 15px !important;
    }

    .emoji-option {
        font-size: 1.8rem !important;
        padding: 12px 5px !important;
    }

    .btn-social {
        padding: 12px;
        font-size: 0.95rem;
    }

    .attendance-options {
        flex-direction: column;
    }

    .attendance-option .opt-card {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        text-align: left;
    }


}


@media (min-width: 768px) {
    .ios-bottom-nav-container {
        max-width: 800px;
        margin: 0 auto;
        margin-bottom: 5rem;
        position: relative;
        margin-top: 5rem;
        width: 800px;

        &::before {
            content: unset;
            background: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            mask-image: none;
            -webkit-mask-image: none;
        }
    }

    .dashboard-header {
        display: none;
    }

    html body>.container {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    #create-event-modal,
    #event-explorer-modal,
    #legal-modal,
    #settings-modal,
    #info-overlay,
    #calendar-modal,
    #messenger-modal,
    #confirm-modal {
        max-width: 900px;
        margin: 0 auto;
        margin-top: 5rem;
        height: 600px !important;

        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;

        /* Sicherstellen, dass keine alten Offsets stören */
        bottom: auto !important;
        right: auto !important;
        margin: 0 !important;

        margin-top: 5em !important;
    }

    #create-event-modal .modal-content,
    #event-explorer-modal .modal-content,
    #legal-modal .modal-content,
    #settings-modal .modal-content,
    #info-overlay .modal-content,
    #calendar-modal .modal-content,
    #messenger-modal .modal-content,
    #confirm-modal .modal-content {
        width: 900px !important;
        height: auto !important;
        max-height: 800px !important;
        border: 4px solid #282b3e !important;
        border-radius: 10px !important;
    }

    #settings-modal .modal-header {
        background: #282b3e !important;
    }
}