/* =================================================================
   MOBILE OPTIMIZATIONS FOR ACCOUNT.PHP
   Optimiert für Bildschirme unter 768px Breite
   ================================================================= */

/* Desktop: Hamburger ausblenden */
@media screen and (min-width: 769px) {
    .hamburger {
        display: none !important;
    }
    
    .sidebar-profile {
        /* Desktop position und styles bleiben unverändert */
        transform: translateX(0) !important;
    }
}

/* ============ HAMBURGER BUTTON ============ */
.hamburger {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10002 !important;
    background: rgba(28, 28, 28, 0.7);
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border: none;
}

.hamburger:hover {
    background: rgba(28, 28, 28, 0.85);
}

.hamburger i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    font-size: 28px;
    width: 100%;
    height: 100%;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    box-sizing: content-box;
    color: #fff;
}

/* ============ SIDEBAR OVERLAY ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000 !important;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile Topbar verstecken (falls vorhanden) */
.mobile-topbar {
    display: none !important;
}

@media screen and (max-width: 768px) {
    
    /* ============ GENERAL LAYOUT ============ */
    .main-layout {
        flex-direction: column;
    }
    
    /* ============ HAMBURGER ANZEIGEN ============ */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        min-width: unset;
        min-height: unset;
        padding: 0;
    }
    
    .hamburger i {
        font-size: 24px;
        width: auto;
        height: auto;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        box-sizing: content-box;
    }
    
    .hamburger.hidden {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    /* ============ SIDEBAR ============ */
    .sidebar-profile {
        position: fixed;
        width: 300px;
        height: 100%;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 10001 !important;
        padding: 20px 15px;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        overflow-y: auto;
    }
    
    .sidebar-profile.active {
        transform: translateX(0);
    }
    
    .profile-card {
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .profile-picture {
        width: 80px;
        height: 80px;
    }
    
    .profile-name {
        font-size: 1.2em;
    }
    
    .profile-meta {
        font-size: 0.85rem;
        padding: 12px;
    }
    
    .meta-item {
        padding: 6px 0;
    }
    
    /* ============ MAIN CONTENT ============ */
    .main-content {
        padding: 25px 20px;
        margin-left: 0 !important;
    }
    
    /* Container für Mobile ohne linkes Margin */
    .container {
        margin-left: 0;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .main-content h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1em;
        margin-bottom: 30px;
    }
    
    .settings-group {
        margin-bottom: 35px;
    }
    
    .settings-group h2 {
        font-size: 1em;
        margin-bottom: 20px;
    }
    
    /* ============ SETTINGS GRID ============ */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .settings-box {
        padding: 18px;
        gap: 15px;
    }
    
    .settings-box .icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .settings-text h3 {
        font-size: 1em;
    }
    
    .settings-text p {
        font-size: 0.85em;
    }
    
    /* ============ MODALS ============ */
    .privacy-modal-content {
        width: 95%;
        padding: 24px 20px;
        max-height: 85vh;
        border-radius: 12px;
    }
    
    .privacy-modal-header {
        padding: 0 0 16px 0;
    }
    
    .privacy-modal-header h3 {
        font-size: 1.3em;
    }
    
    .privacy-modal-close {
        top: 12px;
        right: 12px;
        font-size: 28px;
        padding: 6px;
    }
    
    /* ============ PLAYLISTS MODAL ============ */
    #playlistsModal .settings-modal-tab-container > div {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    #playlistsModal a {
        border-radius: 12px !important;
    }
    
    #playlistsModal button[onclick*="confirmDeletePlaylist"] {
        width: 32px !important;
        height: 32px !important;
        top: 10px !important;
        left: 10px !important;
    }
    
    /* ============ CREATE PLAYLIST MODAL ============ */
    #createPlaylistModal .privacy-modal-content {
        max-width: 95%;
    }
    
    /* Form Elements */
    #createPlaylistModal input[type="text"] {
        font-size: 15px;
        padding: 12px 16px;
    }
    
    #createPlaylistModal label {
        font-size: 0.9em;
    }
    
    /* Visibility Options */
    .visibility-option {
        padding: 14px !important;
        flex-direction: column;
        text-align: center;
        gap: 8px !important;
    }
    
    .visibility-option i {
        font-size: 20px !important;
    }
    
    .visibility-option strong {
        font-size: 0.9em;
    }
    
    .visibility-option small {
        font-size: 0.75em;
    }
    
    /* Create Button */
    #createPlaylistModal button[type="submit"] {
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }
    
    /* ============ DELETE CONFIRMATION MODAL ============ */
    #deletePlaylistConfirmModal .privacy-modal-content {
        max-width: 90%;
        padding: 24px 20px;
    }
    
    #deletePlaylistConfirmModal h3 {
        font-size: 1.2em;
    }
    
    #deletePlaylistConfirmModal p {
        font-size: 0.9em;
    }
    
    /* Delete Modal Buttons */
    #deletePlaylistConfirmModal > div > div:last-child {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    #deletePlaylistConfirmModal button {
        width: 100% !important;
        justify-content: center;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    /* ============ REPORTS MODAL ============ */
    #reportsModal .report-item {
        padding: 16px !important;
    }
    
    #reportsModal .settings-avatar-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    #reportsDetailView .settings-glass-card {
        padding: 16px !important;
    }
    
    /* ============ PRIVACY SETTINGS MODAL ============ */
    #privacyModal .setting-item {
        padding: 14px 16px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    #privacyModal .switch {
        align-self: flex-end !important;
    }
    
    /* ============ BUTTONS ============ */
    button,
    .button {
        min-height: 44px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    /* Back Buttons */
    button[onclick*="showReportsList"],
    button[onclick*="closeModal"] {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* ============ ICONS ============ */
    .privacy-modal-icon {
        font-size: 2em;
    }
    
    i.fas,
    i.far {
        line-height: 1;
    }
    
    /* ============ TEXT ============ */
    p {
        line-height: 1.6;
    }
    
    /* ============ SPACING ============ */
    .privacy-modal-content > div {
        margin-top: 16px;
    }
    
    /* ============ SCROLLBAR IN MODALS ============ */
    .privacy-modal-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .privacy-modal-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
    }
    
    .privacy-modal-content::-webkit-scrollbar-thumb {
        background: rgba(124, 58, 237, 0.5);
        border-radius: 3px;
    }
    
    .privacy-modal-content::-webkit-scrollbar-thumb:hover {
        background: rgba(124, 58, 237, 0.7);
    }
}

/* =================================================================
   SMALL MOBILE (unter 480px)
   ================================================================= */

@media screen and (max-width: 480px) {
    
    /* Smaller Padding */
    .main-content {
        padding: 20px 15px;
    }
    
    .privacy-modal-content {
        padding: 20px 16px;
    }
    
    /* Font Sizes */
    .main-content h1 {
        font-size: 1.5em;
    }
    
    .settings-group h2 {
        font-size: 0.9em;
    }
    
    /* Profile Elements */
    .profile-picture {
        width: 70px;
        height: 70px;
    }
    
    .profile-name {
        font-size: 1.1em;
    }
    
    /* Settings Boxes */
    .settings-box {
        padding: 15px;
        gap: 12px;
    }
    
    .settings-box .icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* Modal Headers */
    .privacy-modal-header h3 {
        font-size: 1.1em;
    }
    
    /* Buttons */
    button,
    .button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* =================================================================
   LANDSCAPE MODE ON MOBILE
   ================================================================= */

@media screen and (max-width: 768px) and (orientation: landscape) {
    
    .sidebar-profile {
        flex-direction: row;
        justify-content: space-around;
        padding: 15px 20px;
    }
    
    .profile-card {
        flex-direction: row;
        text-align: left;
        margin-bottom: 0;
    }
    
    .profile-picture {
        width: 60px;
        height: 60px;
    }
    
    .profile-meta {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .meta-item {
        flex-direction: column;
        gap: 4px;
    }
    
    /* Modal Höhe anpassen für Landscape */
    .privacy-modal-content {
        max-height: 80vh;
    }
}
