/* ============================================
   m.account.css — Mobile & Responsive Styles
   Account Dashboard
   ============================================ */

/* ── Modal: kleine Smartphones (≤ 480px) ── */
@media (max-width: 480px) {
    .privacy-modal-content {
        max-width: 97vw;
        padding: 18px 8px 16px 8px;
        border-radius: 12px;
    }
    .privacy-modal-header {
        gap: 8px;
    }
    .privacy-modal-section {
        padding: 10px 7px 8px 7px;
    }
    .privacy-modal-btn {
        padding: 8px 12px;
        font-size: 0.95em;
    }
}

/* ── Tablet (769px – 1024px): gestapeltes Layout ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar-profile {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
        padding: 30px 25px;
        position: relative;
    }
    .main-content {
        padding: 40px;
    }
    .settings-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* ── Mobile Topbar ── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    height: 56px;
    background: rgba(18, 18, 18, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 16px;
    gap: 14px;
}

.mobile-topbar-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* ── Hamburger Button ── */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.hamburger-btn:hover,
.hamburger-btn:focus {
    background: rgba(148, 0, 211, 0.12);
    outline: none;
}
.hamburger-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* ── Sidebar Close Button ── */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.sidebar-close-btn:hover {
    background: var(--accent-danger);
    color: #fff;
    border-color: var(--accent-danger);
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.is-visible {
    display: block;
    animation: fadeInOverlay 0.25s ease;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Mobile Drawer (≤ 768px) ── */
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }
    .sidebar-close-btn { display: flex; }

    /* Sidebar als Drawer */
    .sidebar-profile {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        z-index: 1100;
        overflow-y: auto;
        padding: 60px 20px 80px 20px;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar-profile.is-open {
        left: 0;
        box-shadow: 4px 0 40px rgba(0, 0, 0, 0.6);
    }

    /* Privacy-Link im Drawer statisch platzieren */
    .sidebar-privacy-link {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 24px;
        padding-left: 0;
        text-align: left;
        width: 100%;
    }

    /* Body scroll lock wenn Drawer offen */
    body.sidebar-open { overflow: hidden; }

    .main-layout { flex-direction: column; }
    .main-content { padding: 76px 20px 30px 20px; }
    .main-content h1 { font-size: 2em; }
    .subtitle { font-size: 1.1em; margin-bottom: 30px; }

    .settings-grid { grid-template-columns: 1fr; gap: 20px; }

    .settings-box {
        padding: 20px;
        gap: 15px;
        min-height: 80px;
        transition: all 0.15s ease-in-out;
        position: relative;
        overflow: hidden;
    }
    .settings-box:active {
        transform: scale(0.98);
        background: rgba(42, 42, 42, 0.8);
    }
    .settings-box:focus {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }
    .settings-box:hover {
        transform: translateY(-2px);
        border-color: var(--accent-primary);
        box-shadow: 0 4px 15px rgba(148, 0, 211, 0.15);
        background: rgba(30, 30, 30, 0.7);
    }
    .settings-box::after {
        content: '';
        position: absolute;
        top: 50%; left: 50%;
        width: 0; height: 0;
        border-radius: 50%;
        background: rgba(148, 0, 211, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
        pointer-events: none;
    }
    .settings-box:active::after { width: 120%; height: 120%; }
    .settings-box .icon { width: 40px; height: 40px; font-size: 18px; }
    .settings-text h3 { font-size: 1em; }
    .settings-text p { font-size: 0.85em; line-height: 1.5; }
    .settings-group { margin-bottom: 35px; }
    .settings-group h2 { font-size: 1.1em; margin-bottom: 20px; }
}

/* ── Kleine Smartphones (≤ 480px) ── */
@media (max-width: 480px) {
    .sidebar-profile {
        width: 270px;
        left: -285px;
        padding: 56px 16px 70px 16px;
    }
    .profile-picture { width: 70px; height: 70px; }
    .profile-name { font-size: 1.2em; word-break: break-word; }
    .badge { font-size: 0.7rem; padding: 3px 8px; }
    .profile-meta { padding: 12px; font-size: 0.85rem; }
    .meta-item {
        padding: 8px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 32px;
    }
    .meta-item span:first-child { font-size: 0.8rem; flex: 1; }
    .meta-item span:last-child { text-align: right; font-weight: 500; }
    .main-content { padding: 72px 15px 25px 15px; }
    .main-content h1 { font-size: 1.8em; margin-bottom: 8px; line-height: 1.2; }
    .subtitle { font-size: 1em; margin-bottom: 25px; line-height: 1.4; }
    .settings-box {
        padding: 18px 15px;
        gap: 15px;
        min-height: 88px;
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    .settings-box .icon { width: 44px; height: 44px; font-size: 18px; flex-shrink: 0; }
    .settings-text { flex: 1; }
    .settings-text h3 { font-size: 0.95em; margin-bottom: 4px; line-height: 1.3; }
    .settings-text p { font-size: 0.8em; line-height: 1.4; margin: 0; }
    .settings-group { margin-bottom: 30px; }
    .settings-group h2 { font-size: 1em; margin-bottom: 15px; padding-bottom: 8px; }
    .mobile-topbar { height: 52px; padding: 0 12px; }
    .mobile-topbar-title { font-size: 0.95em; }
}

/* ── Landscape-Modus (≤ 768px) ── */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar-profile {
        width: 260px;
        left: -275px;
        padding: 56px 16px 20px 16px;
    }
    .main-content { padding: 68px 20px 20px 20px; }
    .settings-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .settings-box { padding: 15px; min-height: 70px; }
    .settings-box .icon { width: 36px; height: 36px; font-size: 16px; }
    .settings-text h3 { font-size: 0.9em; }
    .settings-text p { font-size: 0.75em; }
    .mobile-topbar { height: 48px; }
}


/* ── Login-Prompt ── */
.login-prompt {
    width: 100%;
    text-align: center;
    padding: 150px 20px;
}
.login-prompt h1 {
    font-size: 1.8em;
    color: #fff;
    line-height: 1.3;
}
@media (max-width: 480px) {
    .login-prompt { padding: 100px 15px; }
    .login-prompt h1 { font-size: 1.4em; }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    .settings-box,
    .sidebar-profile,
    .sidebar-overlay,
    .settings-box::after {
        transition: none;
    }
    .sidebar-overlay.is-visible { animation: none; }
    .settings-box:hover { transform: none; }
    .settings-box:active { transform: none; }
}

/* ── High Contrast Mode ── */
@media (prefers-contrast: high) {
    .settings-box { border-width: 2px; }
    .settings-box:focus { outline-width: 3px; }
    .sidebar-close-btn { border-width: 2px; }
}
