* {
    box-sizing: border-box;
    max-width: 100vw;
    word-wrap: break-word;
    word-break: break-word;
}

html, body {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    [style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    
    .container, 
    .main-content,
    .panel,
    .post-card,
    .comment-form,
    .comment-item,
    .video-card {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    button,
    input,
    textarea,
    select {
        max-width: 100% !important;
    }
    
    .navbar {
        padding: 0 12px !important;
    }
    
    .form-group {
        margin-bottom: 16px !important;
    }
    
    .form-input,
    .form-textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    .btn-group,
    .actions,
    .post-actions,
    .comment-actions {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    p { font-size: 1rem !important; }
    
    #footerImageLinks {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    #footerImageLinks img {
        height: 55px !important;
        width: auto !important;
        max-width: calc(50% - 10px) !important;
        border: none !important;
    }
}

@media (max-width: 576px) {
    .navbar {
        height: 56px !important;
    }
    
    .logo {
        font-size: 1rem !important;
    }
    
    .logo img {
        width: 28px !important;
        height: 28px !important;
    }
    
    .container {
        padding: 16px 12px !important;
    }
    
    .page-title {
        font-size: 1.35rem !important;
        margin-bottom: 16px !important;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 18px !important;
        font-size: 0.9rem !important;
    }
    
    .post-card,
    .comment-item,
    .video-card {
        padding: 14px !important;
    }
}

.modal-content {
    width: 95% !important;
    max-width: 380px !important;
    margin: 20px !important;
}

@media (max-width: 768px) {
    .user-auth-section {
        gap: 8px !important;
    }
    
    .user-header-wrapper {
        gap: 6px !important;
    }
    
    .user-header-avatar {
        width: 30px !important;
        height: 30px !important;
        border-width: 1px !important;
    }
    
    .user-header-name {
        display: none !important;
    }
    
    .user-logout-btn {
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 576px) {
    .user-auth-section {
        gap: 6px !important;
    }
    
    .user-header-avatar {
        width: 28px !important;
        height: 28px !important;
    }
    
    .user-logout-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}

.long-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
